A production-ready full-stack monorepo featuring Next.js, FastAPI, Django, Rust (Actix), Python gRPC, PostgreSQL, Jenkins CI/CD, and Traefik reverse proxy - all containerized with Docker.
- Docker Desktop (Required)
- uv (Recommended for local development)
-
Clone the repository
git clone https://github.com/nishanth-kj/NexPyRS.git cd NexPyRS -
Start all services
docker-compose up -d --build
-
Access your services (see URLs below)
That's it! All services will be running and accessible through Traefik.
All services are accessible through Traefik reverse proxy with subdomain-based routing:
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost | Next.js application (Port 80) |
| FastAPI | http://api.localhost | FastAPI backend with auto docs |
| Django Admin | http://django.localhost/admin | Django administration panel |
| PgAdmin | http://pgadmin.localhost | PostgreSQL database management |
| Jenkins | http://jenkins.localhost | CI/CD automation server |
| Traefik Dashboard | http://localhost:8090 | Monitor all routes and services |
| gRPC Service | http://grpc.localhost | Python gRPC service |
| Rust Service | http://rust.localhost | Actix-web microservice |
PgAdmin:
- Email:
admin@nexpyrs.dev - Password:
admin
PostgreSQL:
- User:
postgres - Password:
password - Database:
nexpyrs
Jenkins:
- Get initial password:
docker exec nexpyrs-jenkins-1 cat /var/jenkins_home/secrets/initialAdminPassword
NexPyRS/
βββ web/ # Next.js 14 frontend
β βββ app/ # App router pages
β βββ components/ # React components
β βββ Dockerfile
βββ api/ # Python backend services
β βββ fastapi_app/ # FastAPI application
β βββ django_app/ # Django application
β βββ Dockerfile.fastapi
β βββ Dockerfile.django
βββ grpcsvc/ # Python gRPC service
β βββ server.py
β βββ Dockerfile
βββ rustsvc/ # Rust Actix-web service
β βββ src/
β βββ Dockerfile
βββ traefik/ # Traefik configuration
β βββ dynamic.yml # Static route definitions
βββ docker-compose.yml # Main orchestration file
βββ .env.example # Environment variables template
-
Copy environment file
cp .env.example .env
-
Install Python dependencies (optional, for IDE support)
cd api uv sync -
Install Node dependencies (optional, for IDE support)
cd web npm install
Frontend:
cd web
npm run dev
# Access at http://localhost:3000FastAPI:
cd api
uv run main.py fastapi
# Access at http://localhost:8000Django:
cd api
uv run main.py django
# Access at http://localhost:8001Uncomment the ports section in docker-compose.yml to enable direct access:
# Example for frontend:
ports: # Uncomment for direct access (bypassing Traefik)
- "3000:3000"This allows accessing services directly:
- Frontend:
http://localhost:3000 - FastAPI:
http://localhost:8000 - Django:
http://localhost:8001
This project includes specialized Docker configurations for different environments:
| Environment | Command | Description |
|---|---|---|
| Development | docker-compose -f docker-compose.dev.yml up -d |
Hot-reloading, debug mode, direct port access. |
| Staging | docker-compose -f docker-compose.stage.yml up -d |
Pre-production testing with staging URLs. |
| Production | docker-compose -f docker-compose.prod.yml up -d |
Hardened security, HTTPS (TLS), resource limits. |
docker-compose up -d# All services
docker-compose logs -f
# Specific service
docker-compose logs -f frontenddocker-compose restart frontenddocker-compose psCreate a .env file in the project root (use .env.example as template):
# Project
PROJECT_NAME=NexPyRS
STACK_NAME=nexpyrs
DOMAIN=localhost
# Database
POSTGRES_SERVER=db
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_DB=nexpyrs
# PgAdmin
PGADMIN_DEFAULT_EMAIL=admin@nexpyrs.dev
PGADMIN_DEFAULT_PASSWORD=admin
# Ports (for direct access)
FRONTEND_PORT=3000
API_PORT=8000
DJANGO_PORT=8001Traefik uses two configuration methods:
- Docker Labels (in
docker-compose.yml) - For auto-discovery - Static File (
traefik/dynamic.yml) - For manual route definitions
The static file is used as a fallback on Windows where Docker socket access may have issues.
Frontend:
- Next.js 14 (React 18, App Router)
- TailwindCSS
- Shadcn UI
- TypeScript
Backend:
- FastAPI (Python 3.12) - REST API
- Django 5.0 (Python 3.12) - Admin & ORM
- Python gRPC - Microservices communication
- Rust Actix-web - High-performance service
Infrastructure:
- PostgreSQL 17 - Database
- Traefik v3.0 - Reverse proxy & load balancer
- Jenkins LTS - CI/CD automation
- PgAdmin - Database management
- Docker & Docker Compose
Browser Request
β
Traefik (Port 80)
β
βββ localhost β Frontend (Next.js)
βββ api.localhost β FastAPI Backend
βββ django.localhost β Django Backend
βββ pgadmin.localhost β PgAdmin
βββ jenkins.localhost β Jenkins
βββ grpc.localhost β gRPC Service
βββ rust.localhost β Rust Service
A CI/CD workflow is included in .github/workflows/ci.yml that:
- Runs backend tests (FastAPI & Django)
- Runs frontend tests (linting, build, unit tests)
- Builds Docker images
- Performs code quality checks (ruff, mypy)
Jenkins is pre-configured with Docker-in-Docker support for building and deploying containers.
First-time setup:
- Access http://jenkins.localhost
- Get password:
docker exec nexpyrs-jenkins-1 cat /var/jenkins_home/secrets/initialAdminPassword - Install suggested plugins
- Create admin user
- Go to http://pgadmin.localhost
- Login with credentials (see above)
- Add server:
- Host:
db - Port:
5432 - Username:
postgres - Password:
password
- Host:
docker exec -it nexpyrs-db-1 psql -U postgres -d nexpyrscd api
uv run pytestcd web
npm test- FastAPI Docs: http://api.localhost/docs (Swagger UI)
- FastAPI ReDoc: http://api.localhost/redoc
- Django Admin: http://django.localhost/admin
- Restart Traefik:
docker-compose restart traefik - Check Traefik dashboard: http://localhost:8090
- Wait 10-15 seconds for PostgreSQL to initialize
- Check DB health:
docker-compose ps db
- This is normal - Jenkins is working
- Just access http://jenkins.localhost in browser
# Check if container is running
docker-compose ps
# View logs
docker-compose logs <service-name>
# Restart service
docker-compose restart <service-name>- The project uses static file configuration as fallback
- Routes are defined in
traefik/dynamic.yml - No action needed - everything should work
For Production:
- Change all default passwords in
.env - Enable HTTPS in Traefik configuration
- Set secure database credentials
- Configure proper CORS settings
- Enable authentication on all services
- Review and update security headers
- Next.js Documentation
- FastAPI Documentation
- Django Documentation
- Traefik Documentation
- Docker Compose Documentation
See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details
- Nishanth KJ - GitHub
Built with β€οΈ using Next.js, FastAPI, Django, Rust, and Docker