How yogeshgit11/hritik-roshan-area_drf-react works
Project Type and Purpose
• This is a full-stack web application (“HRMOVIES_API”) with a React frontend and a Django REST Framework backend.
• Purpose: display and search Hritik Roshan movies, show detailed info, allow downloads.
File Structure
• Top level:
• HRMOVIES_API/ — Django REST backend
• frontend/ — React single-page application
• Backend folders:
• HRMOVIES/ — Django project settings (asgi.py, wsgi.py, urls.py)
• movies/ — Django app: models.py, views.py, admin.py, migrations/
• movies/api/ — DRF serializers, views, URLs
• Frontend folders:
• src/ — React components, App.js, index.js
• Database: db.sqlite3
README Insights
• Stack: React (frontend), Django REST Framework (backend), SQLite.
Main Components
a. Client / Browser (React SPA)
b. Web Server / CDN (serves React static bundle)
c. Backend API Server (Django w/ DRF)
d. Database (SQLite)
e. (Optional) Media Storage for movie posters or downloads
Interactions & Data Flow
1. User opens the React app in a browser.
2. Browser loads static assets (index.html, JS, CSS) from the web server or CDN.
3. React UI (components/FindMovies.js, etc.) issues HTTP(S) requests to Django API endpoints.
4. Django URL router (HRMOVIES/urls.py + movies/api/urls.py) directs requests to DRF views.
5. DRF views use serializers (serializer.py) to translate between Django models (models.py) and JSON.
6. Django ORM reads/writes to SQLite (db.sqlite3).
7. Responses (JSON payload or download stream) return to the React client.
Architectural Patterns & Design Principles
• Separation of concerns: UI layer (React) vs. API layer (Django REST).
• MVC within Django: models.py (data), views.py (logic), serializers (presentation).
• Single-page application (SPA) pattern for the frontend.
• Stateless REST endpoints.
• Local relational storage (SQLite) as persistence.