A Go-based backend service for managing and tracking testing training sessions and progress.
The project follows a clean architecture pattern with the following structure:
.
├── cmd/ # Application entry points
├── internal/ # Private application code
│ ├── app/ # Application setup and configuration
│ ├── entities/ # Domain entities
│ ├── storage/ # Data storage implementations
│ └── usecase/ # Business logic
├── pkg/ # Public libraries
├── config/ # Configuration files
├── etc/ # Additional configuration and resources
├── middlewares/ # HTTP middleware components
├── scripts/ # Utility scripts
└── utils/ # Utility functions
- Go 1.23.1: Main programming language
- Gin: Web framework
- PostgreSQL: Database
- Docker: Containerization
- JWT: Authentication
- gRPC: RPC framework
- Swagger: API documentation
- Go 1.23.1 or higher
- Docker and Docker Compose
- PostgreSQL (if running locally)
- Clone the repository:
git clone <repository-url>
cd testing_trainer- Start the services using Docker Compose:
docker-compose up -dThis will start:
- PostgreSQL database on port 5432
- Application server on port 7001
The application uses the following environment variables:
TOKEN_MINUTE_LIFESPAN: JWT token expiration time in minutes (default: 24)REFRESH_HOUR_LIFESPAN: Refresh token expiration time in hours (default: 48)API_SECRET: Secret key for API JWT tokensREFRESH_SECRET: Secret key for refresh tokens
The API documentation is available through Swagger UI at /swagger/index.html when the application is running.
go build -o app ./cmd/apigo test ./...The project uses Goose for database migrations. To run migrations:
goose -dir ./migrations upThe project includes Docker configuration for both the application and database:
Dockerfile: Application container configurationdocker-compose.yaml: Multi-container setup with PostgreSQL
[Add your license information here]
[Add contribution guidelines here]