A production-patterned REST API built with Django and MySQL, fully containerized with Docker, and deployed with an automated CI/CD pipeline using GitHub Actions.
GitHub Push → GitHub Actions CI → Run Tests → Build Docker Image
↓
Django REST API
↓
MySQL (Dockerized)
| Layer | Technology |
|---|---|
| API Framework | Django 5.1.5 + Django REST Framework |
| Database | MySQL 8.0 |
| Containerization | Docker + Docker Compose |
| CI/CD | GitHub Actions |
| Language | Python 3.11 |
- Docker & Docker Compose installed
- Python 3.11+
# Clone the repo
git clone https://github.com/CTURINO01/devops-portfolio.git
cd devops-portfolio/backend
# Copy environment variables
cp .env.example .env
# Start all services
docker-compose up --build
# API is live at:
http://localhost:8000/api/| Method | Endpoint | Description |
|---|---|---|
| GET | /api/projects/ |
List all projects |
| POST | /api/projects/ |
Create a project |
| GET | /api/projects/<id>/ |
Get a project |
| PUT | /api/projects/<id>/ |
Update a project |
| DELETE | /api/projects/<id>/ |
Delete a project |
Every push to main automatically:
- Spins up a MySQL 8.0 service container
- Installs Python dependencies
- Runs Django migrations
- Runs the test suite
- Builds the Docker image
devops-portfolio/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions pipeline
├── backend/
│ ├── Dockerfile
│ ├── docker-compose.yml
│ ├── requirements.txt
│ ├── manage.py
│ ├── core/ # Django settings
│ └── api/ # REST API app
└── README.md
SECRET_KEY=your-secret-key
DEBUG=True
DB_NAME=devops_db
DB_USER=devops_user
DB_PASSWORD=yourpassword
DB_HOST=db
DB_PORT=3306