How adhilgafoor00-stack/online_computer_hardware_selling_web_project works
This is a small full‑stack e‑commerce web application:
• Frontend: static vanilla HTML/CSS/JS pages (multiple entry points: index.html, products.html, cart.html, order.html, admin.html, etc.)
• Backend: Flask / Flask‑RESTful API in backend/app.py
• Persistence: SQLite dev database (backend/database.db), with an intended PostgreSQL production option
• Core domains: product catalog, cart, orders, authentication/authorization, and admin management
• Browser-based UI → REST API → database
• Role separation (customer vs admin)
• Major API resources (products, cart, orders, auth, admin)
• Where static assets live and how they’re served/deployed
Top-level structure indicates a monorepo with a static front end and a Python backend:
Frontend (static)
• HTML pages at repo root:
index.html, products.html, cart.html, order.html, pc-builder.html, admin.html, register.html, signup.html, service.html
• Assets:
css/style.css, js/script.js, images/
Backend
• backend/app.py → likely contains Flask app creation + routing/resources for /api/...
• backend/requirements.txt → runtime deps (Flask, Flask‑RESTful, SQLAlchemy)
• backend/database.db → SQLite file (dev persistence)
Config/IDE
README-derived architecture details
From README:
• REST API endpoints for products/cart/orders/admin/auth
• Auth includes password hashing + role-based access control (RBAC)
• DB: SQLite (dev) / PostgreSQL (prod)
• “Admin dashboard” exists (admin UI + admin API routes)
This project is small enough that one page can contain Level 1 + a simplified Level 2 callout.
Architectural patterns / principles to highlight
• Client–Server with RESTful API
• Resource-based routing (products, cart, orders, auth, admin)
• RBAC for admin operations
• ORM-based persistence (SQLAlchemy)
• Environment-dependent DB (SQLite vs PostgreSQL)
Labels (be explicit)
• Name components with both role + artifact:
• “Frontend Pages (HTML)” + list key pages
• “Frontend Logic (js/script.js - Fetch/AJAX)”
• “Flask REST API (backend/app.py / Flask‑RESTful)”
• “SQLAlchemy ORM”
• “Relational DB (SQLite dev / Postgres prod)”
• Browser → Static hosting: “GET /index.html, /css/style.css, /js/script.js”
• Browser JS → Flask API: “HTTPS JSON REST”
• Flask API → DB: “SQLAlchemy (CRUD)”
• DB → Flask → Browser: “JSON responses”
Don’t overthink it: split into *more* components than fewer
• API Gateway/Flask routing
• Auth/RBAC
• Catalog
• Cart
• Orders
• Admin
• ORM layer
• DB
Even if all of that is currently in backend/app.py, it’s still the real architecture at the system level.