How keshav2136/online-retail-marketplace works
Project Type and Purpose
• This is a full-stack, monolithic Django web application (MVT pattern) that exposes HTML pages and REST-style endpoints.
• It provides an online shopping interface (front-end templates powered by Bulma & jQuery) and a backend (Django views, models, ORM) for user management, product browsing, and seller data.
File Structure
• Top-level files: Pipfile/Pipfile.lock (Python dependencies), requirements.txt, Procfile (Heroku/Gunicorn deploy).
• onlineretail/ — Django project root containing:
– onlineretail/settings.py, urls.py, wsgi.py, asgi.py
– Two Django apps: home/ (catalog, landing page) and user/ (authentication & profile).
– db.sqlite3 (local database).
– static/ (css, js) and templates/ (HTML).
• No separate microservices—single codebase.
README for Additional Insights
• Front-end stack: jQuery + Bulma CSS.
• Backend: Python, Django (mentions Firebase, MongoDB for seller info, MySQL for real users—those would be external or future data stores).
• Deploy via Heroku (Procfile).
Main Components & Interactions
a. Client (Web Browser)
– Loads static assets (HTML, CSS, JS) from Django’s static file handler.
– Initiates HTTP(S) requests for pages or API endpoints.
b. Django Application Server
– URL Router → View functions (home.views, user.views)
– Templates rendered into HTML; JSON responses for AJAX.
– ORM layer communicates with a relational DB (SQLite locally; eventual MySQL for users).
– May also call out to Firebase or MongoDB for seller/inventory data (via external SDK or REST).
c. Database Layer
– Primary DB: SQLite for dev; MySQL in production for user data.
– Secondary DB (external): MongoDB for seller/inventory; Firebase (Auth, Storage).
d. Deployment Environment
– Gunicorn (Procfile) running WSGI/ASGI process on Heroku dyno.
– Environment variables for SECRET_KEY, DATABASE_URL, Firebase creds.
Architectural Patterns & Design Principles
• MVC/MVT—Separation of concerns:
– Models (user.models, home.models)
– Views (processing logic, user.views, home.views)
– Templates (UI layer)
• Modularization by feature: home vs user apps.
• Externalize static assets for caching/CDN.
• Future-proof for multi-database support.
– UI layer (templates, static assets)
– Application layer (Django router, views, models)
– Persistence layer (SQLite/MySQL, MongoDB, Firebase)
– Deployment/runtime (Heroku dyno, Gunicorn).