How chandrima0503/catalyst-count works
Project Type and Purpose
• This is a monolithic, full-stack Django (MVT) web application named “catalyst-count.”
• Purpose: Allow authenticated users to upload CSV data, build and run count/aggregation queries on that data, and view results via a browser interface.
File Structure
• Top-level:
• manage.py
• catalyst_count/ (project configuration: settings, URLs, ASGI/WSGI)
• count_query/ (Django app: models, views, serializers, forms, templates)
• requirements.txt
• .github/workflows/django.yml (CI pipeline)
• Patterns:
• MVT (Model–View–Template) in count_query/
• Configuration via environment variables (.env → settings.py loads DATABASE_URL, SECRET_KEY)
• Use of serializers (suggests REST-style data handling)
• Deployment:
• ASGI/WGSI entrypoints in catalyst_count/asgi.py & wsgi.py
• Database migrations via manage.py
README for Additional Insights
• Tech stack: Python, Django, PostgreSQL
• Runtime environment: virtualenv, pip, .env file for secrets and DB URL
• Usage flow: register/login → upload CSV → run queries
Components
a. User & Browser
– Interacts via HTTP/HTTPS.
b. Web Server Layer
– Django’s ASGI/WSGI server (e.g., Gunicorn or Daphne if deployed).
c. Django Project
– Settings & Configuration (loads .env)
– URL Router (catalyst_count/urls.py → count_query/urls.py)
– Middleware (authentication, static‐files handling)
– count_query App:
• Views & Forms (views.py, forms.py)
• Templates (HTML templates under templates/count_query/)
• Serializers (serializers.py) for JSON or AJAX endpoints
• Models (models.py) and ORM mapping
d. Database
– PostgreSQL (configured via DATABASE_URL).
e. File Storage
– CSV upload temporarily stored on disk or cloud storage (local MEDIA folder).
f. Optional CI/CD
– GitHub Actions (.github/workflows/django.yml)
Relationships and Data Flows
• Browser → (HTTP request) → Django ASGI/WSGI server
• ASGI/WSGI → settings & URL router → dispatch to appropriate view
• Views:
• If file upload: handle multipart/form-data → save file → kick off parsing
• If query: accept form data → build ORM query → interact with DB
• Return rendered template or JSON response via serializer
• Django ORM → SQL → PostgreSQL → return result sets → views
• Views → templates → HTML → HTTP response → browser
• Authentication:
• login/signup flows via Django auth system → sessions/cookies
Architectural Patterns & Tech
• MVT (Model–View–Template) layered separation
• ORM for data access
• Environment-driven config for secrets and DB
• GitHub Actions for CI (runs tests, linting, migration checks)