How thomas-mckanna/django-rolla-mission works
Project type and purpose
• This is a full‑stack Django web application with a REST API used by a companion Android app, plus a browser‑based admin/UI.
• Its purpose is to receive and store check‑in data (including images) from an Android client, manage that data via web pages (templates + Django Admin), and serve/report it back to clients.
File structure
Top‑level modules:
• rolla_mission/ – the Django project (settings, URLs, WSGI/ASGI, storage backends)
• patron_checkin/ – a Django app providing models, views, templates, static CSS, URLs, and migrations for check‑in features & admin UI
• api/ – a Django REST Framework app exposing serializers, viewsets, and URL endpoints for the Android client
• checkin_date_filter/ – a small app supplying custom filters and views used by patron_checkin
• conf/ – Apache HTTPD configuration for hosting (mod_wsgi + proxy setups)
• static/ and templates/ – compiled and third‑party static assets (Django Admin, DRF docs, base templates)
• requirements.txt – Python dependencies
README for additional insights
• Hosted on AWS Lightsail behind HTTPS
• Postgres as primary relational DB
• AWS S3 used for all image/media storage
• Android app communicates via DRF API
• Secrets and environment variables injected via a wrapper script
Main components & their relationships
a. Clients
• Android Application (external mobile client)
• Web Browser (Django Admin & custom HTML templates)
b. Web/API Layer
• Apache HTTPD (reverse proxy, SSL termination)
• uWSGI/mod_wsgi or Gunicorn serving the Django application
• Django project (“rolla_mission”) with three apps:
• api (REST endpoints)
• patron_checkin (UI views, models, admin)
• checkin_date_filter (utility filters)
c. Data Storage
• PostgreSQL Database (primary relational store)
• AWS S3 Bucket (media/images)
d. Infrastructure / External Services
• AWS Lightsail instance
• AWS S3 service
• (Optional) AWS RDS if Postgres is managed in production
Data flows & interactions
• Android App → HTTPS → Apache HTTPD → Django/api.views → serializers → ORM → PostgreSQL
• Django Views (patron_checkin) → ORM → PostgreSQL → render templates → Browser
• Django Media Uploads → boto3/S3 backend → AWS S3
• Browser or Android → fetch media URLs directly from S3 (or via signed URLs)
Architectural patterns & design principles
• Monolithic Django project segmented into reusable “apps” for domain separation
• MVC‑style (Django views/templates/models) augmented by RESTful resources (DRF serializers & viewsets)
• 12‑factor app principles: environment‑based configuration, external backing services (Postgres, S3)
• Separation of concerns: static/media vs. dynamic content, admin vs. API vs. public UI