How lilimly/orinoco works
Project type and purpose
• Full-stack application: a Node.js/Express back end serving a REST API, and a static front-end (HTML/CSS/JS) hosted separately.
• Purpose: serve product data (cameras, furniture, teddy) from MongoDB to browser-based pages (index, produit, panier, confirmation).
File structure
• Top-level back-end files:
– server.js (boots Express, connects to MongoDB)
– app.js (sets up middleware, imports routes)
– routes/*.js (defines REST endpoints per resource: camera, furniture, teddy)
– controllers/*.js (implements business logic for each endpoint)
– models/*.js (data schema/DB-access layer for each resource)
• Static front-end (served via GitHub Pages or Express static middleware):
– HTML: index.html, produit.html, panier.html, confirmation.html
– JS: index.js, produit.js, panier.js, confirmation.js (client-side scripts using fetch to call the API)
– Styles: SCSS in scss/ → compiled into css/style.css
• Config & dependencies: package.json, node_modules, .lock file.
README for insights
• Confirms Node/npm setup, “npm start” → “node server”
• Server listens on localhost:3000 by default
• Front-end is accessible at a GitHub Pages URL
a. Main components:
1. Browser/Client (blue) – renders HTML, runs JS, SCSS→CSS assets
2. Front-end assets host (could be GitHub Pages or Express static)
3. API Server (green):
• Express application (server.js/app.js)
• Router layer (routes/*.js)
• Controller layer (controllers/*.js)
• Model/DB layer (models/*.js + Mongoose)
4. Database (orange): MongoDB Atlas or local MongoDB instance
5. Optional: SCSS compiler/build pipeline
• Browser → HTTP GET/POST → Express Router → Controller → Model → MongoDB
• MongoDB → Query result → Model → Controller → JSON response → Browser
• SCSS source → Build → CSS → Browser
c. Architectural patterns:
• MVC-style separation inside the API (routes → controllers → models)
• RESTful API endpoints (e.g. GET /api/cameras)
• Static asset serving for front-end
d. Key technologies:
• Node.js + Express
• Mongoose for MongoDB
• Vanilla JS fetch API on the client
• SCSS preprocessor → CSS
• GitHub Pages (or Express) for static hosting
Detail to capture
• Major route (camera, furniture, teddy) under the Router layer.
• Under Controllers, note business logic modules.
• Under Models, show schema definitions and DB connection.
• How SCSS files in scss/utils feed into css/style.css.
• Static-file serving (app.use(express.static(...)) or GitHub Pages).