A Django-based screening system with gRPC support, Celery workers, and PostgreSQL database.
- Docker
- Docker Compose
- Python 3.13
- Poetry:
# Install the dependencies
poetry install
# Activate the virtual environment
poetry shellRun the following command to start all services:
docker compose up --buildThis will start the following services:
- PostgreSQL Database (port 5432)
- Redis (port 6379)
- Django Web Server (port 8000)
- gRPC Server (port 50051)
- Celery Worker (background tasks)
Once all services are running, you can access:
- Web Application: http://localhost:8000
- gRPC Server: localhost:50051
| Service | Description | Port | Health Check |
|---|---|---|---|
| web | Django web server | 8000 | /health/startup-probe/ |
| grpc | gRPC server | 50051 | - |
| worker | Celery background worker | - | celery inspect ping |
| postgres | PostgreSQL database | 5432 | pg_isready |
| redis | Redis cache/message broker | 6379 | - |
-
Swagger:
GET /api/v1/docs/ -
Create Candidate:
POST /api/v1/candidates/ -
Retrieve Candidate:
GET /api/v1/candidates/{id} -
Health Check:
GET /health/startup-probe/- Returns application health status
- Used by Docker health checks
The gRPC server provides the following services defined in app/grpc/proto/candidate.proto:
- GetCandidateStatus
- Request:
CandidateIdRequest { id: string } - Response:
Candidate { status: string, screening_log: ScreeningLog } - Description: Retrieve candidate status and screening information
- Request:
-
Candidate
message Candidate { string status = 1; ScreeningLog screening_log = 2; }
-
ScreeningLog
message ScreeningLog { bool is_duplicate = 1; bool is_blacklisted = 2; bool is_email_format_valid = 3; }
-
CandidateIdRequest
message CandidateIdRequest { string id = 1; }
docker compose down# All services
docker compose logs -f
# Specific service
docker compose logs -f web
docker compose logs -f grpc
docker compose logs -f workerdocker compose up --build --force-recreate# Run migrations
docker compose exec web python manage.py migrate
# Create superuser
docker compose exec web python manage.py createsuperuser
# Access Django shell
docker compose exec web python manage.py shell# Check worker status
docker compose exec worker celery -A app inspect ping
# View active tasks
docker compose exec worker celery -A app inspect activeThe system consists of:
- Django Web Application: Handles HTTP requests and admin interface
- gRPC Server: Provides high-performance API for candidate operations
- Celery Workers: Process background tasks asynchronously
- PostgreSQL: Primary database for persistent data
- Redis: Message broker for Celery and caching
- Port conflicts: Ensure ports 5432, 6379, 8000, and 50051 are available
- Database connection: Wait for PostgreSQL health check to pass before accessing the application
- Environment variables: Verify
.envfile is properly configured
# Check if all containers are running
docker compose ps
# Check specific service logs
docker compose logs [service_name]