How londheshubham153/django-notes-app works
Project Type and Purpose
• Full-stack web application
• Frontend: React SPA (“mynotes” directory)
• Backend: Django REST API (“api” app within “notesapp” project)
• Data store: SQLite (db.sqlite3)
• Deployed via Docker, reverse-proxied by Nginx
File Structure
• Top-level:
– Dockerfile, docker-compose.yml, Jenkinsfile, Procfile
– manage.py, requirements.txt (Python), mynotes/package.json (Node)
– nginx/Dockerfile + default.conf (reverse proxy)
• “notesapp/” – Django project (settings, URLs, WSGI/ASGI)
• “api/” – Django app: models.py, serializers.py, views.py, urls.py, migrations
• “mynotes/” – React app:
– “src/” holds components, pages, assets
– “build/” holds production artifacts (HTML/CSS/JS)
• “staticfiles/” – Collected Django static assets (including React build and DRF docs)
• “db.sqlite3” – Local relational database
README for Context
• Describes building a Docker image and running it on port 8000
• Advises installing Nginx reverse proxy on the host
• The app is intended as a simple note-taking service
Main Components and Interactions
a. Frontend (React SPA)
– Served as static files (index.html, .js, .css)
– Hosted behind Nginx (or Django static handler)
– Runs in the user’s browser
b. Reverse Proxy (Nginx)
– Accepts HTTP requests on port 80/443
– Routes “/api/” calls to Django container on port 8000
– Serves static assets directly (React build, Django admin CSS/JS)
c. Backend (Django REST Framework)
– Exposes REST endpoints under /api/
– Implements CRUD for Note model
– Uses Django ORM over SQLite
d. Database (SQLite)
– File-based local DB (db.sqlite3)
e. CI/CD (Jenkins)
– Builds Docker images, runs tests, pushes to registry
f. Container Orchestration (Docker Compose)
– Defines “web” (Django), “nginx” services
– Mounts volumes for code and static files
Architectural Patterns and Design Principles
• Separation of Concerns:
– UI (React) vs. API (Django DRF) vs. Data (SQLite)
• Layered Architecture:
– Presentation (Browser + React)
– API/Business (Django views, serializers, models)
– Data Access (ORM → SQLite)
• Reverse Proxy Pattern:
– Nginx handles TLS, caching, static content, load balancing
• Containerization:
– Each component runs in its own Docker container
Final Checklist for the Engineer
– Add callouts for important config: docker-compose.yml, nginx/default.conf, settings.py