This is an early prototype of an admissions system for the L2SH (Лицей "Вторая школа") school.
The system is built with Go (Echo framework) and Vue.js. It uses Redis for caching and PostgreSQL for the database. A React Admin panel is provided for administration and API for it is built with PostgREST.
- 🗂️ Project structure
- 🚀 Build and run
- 🔒 Authentication
- ✉️ Email sending with NotiSend
- 🛎️ Administration
- 🎨 Admin Panel
- 🧪 Testing
cmd/
- application entry pointsinternal/
- internal packagesui/
- frontendtests/
- testsadmin-panel/
- React Admin panelconfig.yml
- configuration
Before running the application, make sure to set the required environment variables secrets.
docker compose up --build --watch
--watch
- update the container on code changes
docker compose up --build
Default ports:
server
- 8888 (set inconfig.yml
)admin-panel
- 4444ui
- 3000 (Vite development server)pgadmin
- 5050database
- 5432
Secrets are loaded from environment variables.
Set the following variables before running the application:
- DB_PASSWORD - password for the database
- JWT_KEY - secret key for JWT signing
- MAIL_API_KEY - NotiSend API key
- ADMIN_PASSWORD - password for the default admin user
This project features a robust JWT-based authentication system with automatic token rotation for every login or refresh, ensuring users are seamlessly re-authenticated without manual re-login. Each token is stored in Redis for quick invalidation, allowing flexible auto-logout and enhanced session control.
Passwords are secured using Argon2 with distinct, randomly generated salts, providing state-of-the-art security against brute force attacks. User-friendly password guidelines (minimum length, mixed case, digits, and special characters) further strengthen credentials and reduce the risk of weak passwords.
This service uses NotiSend for email verification and other automated notifications. It calls a NotiSend API endpoint in the “mailing” package using an API key secured in environment variables. This approach removes SMTP complexity and lets NotiSend handle delivery. Email can be disabled locally by setting “mailing.enabled” to false in config.yml or mocking the calls.
The application logs to stdout
, which can be viewed with docker logs
command.
docker logs admissions
Credentials to connect to the development database are in docker-compose.yml
and DB_PASSWORD
secret.
The admin panel is a separate frontend built with PostgREST and React Admin. A Docker service is provided in the docker-compose.yml under the "admin-panel" service. It can be accessed at http://localhost:4444 once the container is running.
go test -v ./...
go test -v -coverprofile=coverage.out ./...
coverage.out
file will be generated in the project root directory.
To view the coverage report, run:
go tool cover -html=coverage.out