A system for creating and managing assessments with different scoring methods.
- Docker and Docker Compose
- Python 3.x (for local development)
- Node.js 22.x (for local client development)
api/: FastAPI backend serviceclient/: React 19 frontend application with Vite
- Clone the repository:
git clone <repository-url>
cd <project-directory>- Copy the environment files and configure your variables:
# API environment
cd api
cp .env.example .env.development
# Client environment
cd ../client
cp .env.example .env.development- Start the development environment:
docker-compose upThis will start:
- The client application at http://localhost:5173
- The API service at http://localhost:8000
- A PostgreSQL database at localhost:5432
Once the API is running, you can access:
- Interactive API documentation (Swagger UI): http://localhost:8000/docs
- Alternative API documentation (ReDoc): http://localhost:8000/redoc
To run the test suite:
# Run all tests
docker-compose -f docker-compose.test.yml up --build --abort-on-container-exit
# Run specific tests
docker-compose -f docker-compose.test.yml run api pytest api/tests/specific_test.py
# Run with coverage report
docker-compose -f docker-compose.test.yml run api pytest --cov=api api/tests/To deploy the application in production:
- Configure production environment variables:
# API production environment
cd api
cp .env.example .env
# Edit .env.prod with your production settings
# Client production environment
cd ../client
cp .env.example .env
# Edit .env.prod with your production settings- Build and start the production services:
docker-compose -f docker-compose.prod.yml up --build -dThis will start:
- The client application at http://localhost:5173 (served by nginx)
- The API service at http://localhost:8000
- A PostgreSQL database at localhost:5432
- Create the initial admin user in production (if first deployment):
docker-compose -f docker-compose.prod.yml exec api pipenv run create-adminThe production environment includes health checks for all services:
- Client: http://localhost:5173/health
- API: http://localhost:8000/health
- Database: Automatically checked by Docker
cd api
pipenv shell
pipenv install
pipenv run create-admin # Create initial admin user
uvicorn main:app --reloadcd client
npm install
npm run devThe client will be available at http://localhost:5173
DATABASE_URL: PostgreSQL connection stringENVIRONMENT: Development/production environmentDEBUG: Enable/disable debug modeSECRET_KEY: JWT secret key (required in production)CORS_ORIGINS: Allowed CORS origins
VITE_API_URL: API endpoint URL (default: http://api:8000 in Docker)HOST: Host to bind the development server (default: 0.0.0.0)
Check .env.example files in both api/ and client/ directories for all available configuration options.
- If you get permission errors with the database volume:
sudo chown -R 1000:1000 postgres_data/- If the client build fails with TypeScript errors in production:
# You can force the build with
docker-compose -f docker-compose.prod.yml build --build-arg TSC_COMPILE_ON_ERROR=true- If you need to reset the database:
# Stop all containers and remove volumes
docker-compose down -v
# Then restart with
docker-compose up --build