Grocery Assistant: a service for publishing recipes, adding them to favorites, subscribing to authors and generating a consolidated shopping list with the ability to download to PDF.
- Project site: nexordon.work.gd
- Server IP address: 51.250.47.12
- Admin panel: nexordon.work.gd/admin/
- API Documentation (Redoc): nexordon.work.gd/api/docs/
- Egor Briliov | Backend Developer
- Telegram | @briliov
- Backend: Python 3.12, Django 6.1, Django REST Framework (DRF), Djoser.
- Database: PostgreSQL 15 (Production) / SQLite (Local Development).
- Frontend: React (SPA application; the container is used for static building).
- WSGI & Web Server: Gunicorn, Nginx.
- Containerization: Docker, Docker Compose (Separate dev/prod configuration environments).
- CI/CD: GitHub Actions (Two independent workflow automation setups, Docker Hub, and Telegram API integration).
- Code Quality: Verified with Flake8 linter adhering strictly to PEP 8 standards.
The application is deployed on a virtual private server inside four isolated containers: nginx, db (PostgreSQL), backend, and frontend. Persistent data stores, media, and static assets are managed using Docker Volumes.
- Clone the repository:
bash
git clone https://github.com/nexordon/foodgram.git
cd foodgram- Configure environment variables:
Create a .env file in the root directory (where your development docker-compose.yml file is located):
env
SECRET_KEY=your_secure_django_secret_key
DEBUG=True
ALLOWED_HOSTS=127.0.0.1,localhost- Launch the local infrastructure using Docker:
Build and start the multi-container development environment:
docker compose up -d --buildNote: In development mode (target: development), the backend container automatically performs database migrations (makemigrations && migrate), loads core system fixtures (load_data), and runs collectstatic before starting the built-in development server.
- Verify execution:
The application will be accessible via standard interfaces through the Nginx gateway on port :80. You can monitor log execution streams using:
docker compose logs -f backendThe project features fully automated staging and deployment layers controlled by GitHub Actions via distinct workflow routines.
To enable automated validations and delivery, make sure to provision the following environmental variables within your GitHub Repository settings (Settings -> Secrets and variables -> Actions):
DOCKER_USERNAME/DOCKER_PASSWORD— Shared keys needed to publish images to DockerHub.HOST/USER/SSH_KEY— Remote Linux parameters targeted by deployment workflows.TELEGRAM_TO/TELEGRAM_TOKEN— Credentials required to deliver operational push alerts.
-
Development Workflow (
dev.yml): Automatically triggers on any push to thedevbranch. It hosts an isolatedpostgres:13.10runner to perform code evaluation assertions (ruff check) and execute tests (python manage.py test). -
Main Deployment Workflow (
main.yml): Automatically runs on any push to themainbranch. It manages the following sequence:-
Runs code quality assertions and tests.
-
Compiles production assets and pushes verified Docker images (
backendandfrontend) directly to your DockerHub space (nexordon/foodgram_backend:latest,nexordon/foodgram_frontend:latest). -
Copies the production compose definitions (
infra/docker-compose.production.yml) and web server setup configs (infra/nginx.conf) to the remote hosting environment over SSH. -
Automatically handles deployment updates on the remote server:
sudo docker compose -f docker-compose.production.yml pull sudo docker compose -f docker-compose.production.yml down sudo docker compose -f docker-compose.production.yml up -d sudo docker container exec foodgram-backend python manage.py migrate sudo docker container exec foodgram-backend python manage.py collectstatic --no-input
In the production environment, the backend server operates securely via a managed Gunicorn WSGI server binding on internal port
:8000, while the custom Nginx templates route traffic and serve static files. -
Dispatches an operational delivery diagnostic summary straight to the configured Telegram endpoint.
-
- API Functional Testing: The workspace contains preconfigured operational templates available inside the
postman_collection/directory to run automated tracking assertions using Postman. - Reviewer Remote Infrastructure Access: Connection strings and server access parameters required to inspect operations on active staging layers are located inside the
tests.ymlconfiguration mapping file (login,password,vm_name).