How josiahcameron/stride works
Project type and purpose
• This is a full-stack habit-tracking web application (“Stride”) with a Django + Django REST Framework (DRF) backend, a React single-page frontend, asynchronous task processing via Celery, and integrations with external services (motivation quotes API, Twilio).
File structure
• Top-level Django project “conf” contains settings, URL routing, ASGI/WSGI and Celery configuration.
• Django apps:
• accounts (custom user, profiles, journaling)
• habits (habit definitions, metadata, completion logic)
• api (DRF-exposed endpoints for CRUD)
• frontend (Django app whose static folder holds the React build)
• celery_tasks (models + tasks, beat schedule)
• Static files:
• frontend/static/src → React source code
• frontend/static/build and staticfiles/build → production React bundles
• Deployment / orchestration:
• Procfile (for Heroku/Gunicorn dyno)
• Pipfile/Pipfile.lock (Python dependencies)
Additional insights from README
• Users have tiered limits, daily streak logic stored in RDBMS.
• DRF CRUD for habits & journal entries.
• Axios in React to consume the API.
• Twilio used to text upon goal completion; motivational quotes pulled from a public REST API.
1. User’s Browser (React SPA + Axios)
2. Django Backend (Gunicorn → conf ASGI/WSGI)
3. PostgreSQL (or configured RDBMS)
4. Message Broker (e.g. Redis or RabbitMQ)
5. Celery Worker & Beat Scheduler
6. External REST API (Quotes API)
7. External SMS Service (Twilio)
• Browser →[HTTP/HTTPS]→ Django REST endpoints
• Django →[SQL]→ Database
• Django →[broker enqueue]→ Celery tasks
• Celery Worker →[HTTP]→ Quotes API
• Celery Worker →[HTTP]→ Twilio API
• Browser ←[static files]← Django (serves React build)
c. Architectural patterns & principles:
• MVC (Django models-views-templates, though templates here are minimal)
• RESTful API layer (DRF)
• Single-Page Application (React)
• Asynchronous task queue (Celery + broker)
• Separation of concerns: authentication, data, background jobs, UI
d. Key technologies & frameworks:
• Django, Django REST Framework
• React, Axios
• Celery, Redis/RabbitMQ
• Gunicorn, Heroku (Procfile)
• PostgreSQL