How ingwaruz/riazanov-mebel-shop works
Project type and purpose
• This is a full‑stack e‑commerce web application (“Riazanov Mebel Shop”) comprising:
• A React‑based SPA client (folder client/)
• An optional Next.js client scaffold (nextjs-client/)
• A Node.js/Express REST API server (folder server/)
• A PostgreSQL database managed via Sequelize
• Nginx as a reverse‑proxy and SSL terminator
Top‑level architecture from the file tree
• client/ (React CRA)
• Organized by features, entities, shared modules, widgets (FSD approach)
• Uses Sass for styling, React Router, REST API calls to server
• server/ (Express + Sequelize)
• MVC‑style layers: routes → controllers → models → database
• Middleware for auth, role checks, error handling
• Migrations, backup scripts
• nextjs-client/ (SSR client stub)
• Infrastructure scripts: build-client.bat, start-server.bat, setup.ps1 (installs Nginx, Certbot)
a. Components
• User’s Browser
• Nginx (reverse proxy & SSL on ports 80/443)
• Frontend(s): React SPA (static files) and/or Next.js SSR
• Backend: Express REST API
• Database: PostgreSQL via Sequelize ORM
• External services: Let’s Encrypt (Certbot) for SSL, Windows Task Scheduler
b. Relationships & data flows
1. Browser → HTTPS → Nginx
2. Nginx → (static) → React build OR → (proxy) → Express API
3. Express → Sequelize queries → PostgreSQL
4. Periodic Certbot renewal via scheduled task → Nginx config reload
5. Migrations/backup jobs → Data store (shown as offline processes)
c. Architectural patterns
• Frontend: Feature‑based modular architecture (FSD)
• Backend: Layered MVC (Routes → Controllers → Services/Models)
• API‑First design: consistent REST endpoints for products, auth, orders
• Infrastructure as code: batch/PowerShell scripts for deployment, SSL
d. Key technologies
• React, React Router, Sass, Fetch/axios
• Next.js (optional SSR path)
• Node.js, Express.js
• Sequelize ORM + PostgreSQL
• Nginx, Certbot
• Windows Task Scheduler
Detail level
• Critical boundaries: Browser ↔ Nginx ↔ (React / Express) ↔ DB
• Special processes: migrations, backups, SSL renewal
• Avoid over‑cluttering: collapse low‑level controller/model details, but call out the MVC pattern