How foxy4096/vitary-classic works
Project type and purpose
• This is a monolithic, full-stack Django web application (“Vitary”) implementing a simple social media platform.
• The README describes user registration, posting, feeds, chat, notifications, GraphQL API, file uploads (via Google Drive storage), and email features.
File structure
• Top-level:
• manage.py – Django CLI entry point
• Vitary/ – Django project settings, URL conf, WSGI/ASGI
• apps/ – seven Django apps (account, api, blog, chat, core, feed, notification)
• media/ – user-uploaded files (images, videos)
• templates/ – global error pages and admin/fallback templates
• req.txt – Python dependencies
• Each app follows standard Django conventions: models, migrations, views, templates, urls, tests.
• apps/api contains both REST and GraphQL endpoints.
• Vitary/asgi.py indicates support for asynchronous protocols (e.g., WebSockets).
• Static assets (CSS/JS) live under apps/core/static.
README for additional insights
• Specifies use of Django + virt env + migrations + Google Drive storage + optional email configuration
a. Main components:
• Client (Web Browser or Mobile Hybrid)
• CDN or Static-file server (serving CSS, JS, images)
• Load-Balancer / Reverse Proxy (e.g., Nginx)
• Application Server (ASGI via Daphne/Uvicorn or WSGI via Gunicorn)
• Django monolith comprising:
– account app (user management, auth)
– core app (templates, context processors, global utilities, HTMX)
– feed app (posts, comments, likes, email notifications)
– blog app (blog posts)
– chat app (direct messages)
– notification app (site notifications)
– api app (REST & GraphQL endpoints)
• Database (PostgreSQL or other)
• External storage (Google Drive via django-googledrive-storage)
• Email service (SMTP)
• (Optional) Cache/Queue (Redis + Celery for feed tasks)
b. Relationships & interactions:
• Browser → Reverse Proxy via HTTPS → Django ASGI/WSGI
• Django → Database for reads/writes
• Django → Google Drive for media storage
• Django → SMTP server for outbound emails
• apps/feed.tasks (Celery workers) ↔ Redis broker ↔ Django
• API clients ↔ apps/api endpoints (REST & GraphQL)
• WebSocket clients → ASGI channel layers (if real-time chat used)
c. Architectural patterns & design principles:
• Monolithic modularization: each feature in its own Django app
• MVC (Django’s MTV) pattern
• Async support via ASGI for real-time features
• Background processing via Celery & Redis (feed tasks, email notifications)
• Externalized storage (Google Drive) for scalability
• Template-driven UI with progressive enhancement (HTMX)
d. Key technologies/frameworks:
• Python 3 + Django
• HTMX for in-page updates
• Graphene or similar for GraphQL schemas
• django-googledrive-storage
• Celery + Redis (if configured)
• PostgreSQL (or default SQLite)
• Nginx + Gunicorn/Uvicorn
Elements
• Clear labels: “Browser”, “Nginx (SSL)”, “Gunicorn/Uvicorn”, each Django app, “PostgreSQL”, “Google Drive”, “SMTP”, “Redis/Celery”
• HTTP/HTTPS requests
• Data reads/writes
• Background job dispatch & result flows
• File upload/download flows
Detail
• Every Django app as a distinct component.
• Static/media serving as a separate flow.
• Both legacy API endpoints and GraphQL schemas under the api app.