How archimedesaj/cms-api works
Main components
a. Client(s) – e.g. web/mobile apps or third-party integrators
b. API Gateway / HTTP Layer – Django’s ASGI/WSGI entrypoints + URL dispatcher (cmsapi/asgi.py, cmsapi/wsgi.py, cmsapi/urls.py)
c. Django Project Core – settings, shared middleware (cmsapi/settings.py)
d. Django Apps (logical modules):
• accounts (authentication, user profiles)
• member (church member records)
• sundayschool (Sunday school classes & rosters)
• visitor (visitor tracking)
e. Business Logic – views (views.py), serializers (serializers.py) within each app
f. Persistence Layer – Django ORM + SQLite (db.sqlite3)
g. Media Store – local filesystem under media/photos/...
h. Development Environment – virtualenv (venv), manage.py
Relationships and data-flow
• Clients send HTTP requests → API Gateway (ASGI/WSGI)
• URL router dispatches to app-specific URL modules (accounts/urls.py, etc.)
• Requests handled by View classes/functions
• Views invoke Serializers → validate/transform input/output
• Serializers interact with Models → Django ORM executes CRUD on SQLite
• ORM writes/reads db.sqlite3; media uploads written to media/
• Responses flow back up to the client
Architectural patterns and principles
• Modular monolith: each app encapsulates its own models, serializers, views, URLs, and tests
• RESTful design: resources exposed via standard HTTP verbs (GET, POST, PUT, DELETE)
• Separation of concerns:
– URL routing → request dispatch
– Views → orchestrate logic
– Serializers → data validation & transformation
– Models → persistence schema
• Use of Django’s built-in admin for management (admin.py)
Technologies/frameworks
• Python 3 + Django REST Framework
• SQLite for quick local development
• Django’s built-in static/media handling
• Virtual environment (venv) for dependency isolation