A Django REST API template for scalable applications, featuring modern CI/CD, Docker Swarm deployments with zero-downtime SSL, automated changelogs, dynamic OpenAPI/Swagger UI documentation, and integrated tests with coverage reports, artifacts, and badges.
For detailed information about the project, please check:
-
💻 Project Design Specifications
Architecture, data models, and API endpoints documentation -
🛠️ Continuous Integration Setup
Pre-commit hooks configuration and automated testing pipeline -
🚀 Continuous Delivery Setup
Docker image build, DockerHub publishing, and DigitalOcean Docker Swarm deployment -
🎨 Style Guide
Project code style guide: commit messages, release versioning
- Django: Python web framework for rapid development
- Django REST Framework: Powerful toolkit for building Web APIs
- DRF-Spectacular: OpenAPI/Swagger documentation generator
- pytest: Feature-rich testing framework
- pytest-django: Django-specific testing utilities
- Coverage.py: Code coverage measurement
- pre-commit: Git hooks framework for code quality checks
- Traefik: Modern reverse proxy and load balancer
- Let's Encrypt: Automatic SSL certificate provisioning
- ACME protocol for automated certificate issuance and renewal
- Zero-downtime certificate rotation
- Black: Uncompromising Python code formatter
- Ruff: Extremely fast Python linter
- mypy: Static type checker
- Docker: Container platform
- Docker Compose: Multi-container development environments
- Docker Swarm: Container orchestration for production
- Zero-downtime deployments with rolling updates
- Automatic service rollbacks on failure
- Health checks and self-healing capabilities
- GitHub Actions: CI/CD automation
- Neovim: Blazingly fast, extensible code editor
- PostgreSQL: Robust relational database
# Start PostgreSQL database
docker run -d \
--name some-postgres \
-e POSTGRES_PASSWORD=postgres \
--rm \
-p 5432:5432 \
docker.io/postgres:16
# Install dependencies
python -m pip install -r requirements/local.txt
# Setup database
python manage.py migrate
# Collect static files
python manage.py collectstatic
# Run server, and open http://localhost:8000/api/docs
python manage.py runserver
# Run tests
pytest
# Type checking
mypy fuel_tracker
# Test coverage
coverage run -m pytest
coverage html
# Build the stack
docker compose -f docker-compose.local.yml build
# Start services
docker compose -f docker-compose.local.yml up
# Setup database
docker compose -f docker-compose.local.yml run --rm django python manage.py migrate
# Run tests
docker compose -f docker-compose.local.yml run --rm django pytest
# Type checking
docker compose -f docker-compose.local.yml run --rm django mypy
# Test coverage
docker compose -f docker-compose.local.yml run --rm django coverage run -m pytest
docker compose -f docker-compose.local.yml run --rm django coverage html
open htmlcov/index.html
- Aidos Kanapyanov ([email protected])
- 💼 LinkedIn Profile
This project is licensed under the MIT License.