How durgesh0108/spectra works
Project type and purpose
• This is a full-stack e-commerce web application (“Spectra Glasses Website”) built with Node.js, Express, MongoDB/Mongoose, and EJS/Pug for server-side rendering.
• It exposes product listings (glasses), user authentication, bookings/orders, reviews, and payment integration (Stripe via public/js/stripe.js).
File structure
• Top-level server: server.js and app.js configure and launch the Express app.
• Controllers: handle incoming HTTP requests (authController, glassController, bookingController, reviewController, userController, viewController, errorController, handlerFactory).
• Routes: map URL endpoints to controllers (routes/*.js).
• Models: Mongoose schemas for Glass, User, Review, Booking.
• Views: Pug/EJS templates for server-rendered pages (views/*.pug, views/*.ejs).
• Public assets: CSS/JS/images under public-1 and public.
• Utils: shared helpers (apiFeatures for query filtering/pagination, catchAsync, appError, email).
• Dev-data: seed scripts and JSON fixtures for development.
• Configuration: .eslintrc.json, .prettierrc, tailwind.config.js.
Key insights from README
• Confirms Express/MongoDB/Mongoose stack.
• Fully working e-commerce site (products, users, bookings, reviews, payments, emails).
Detail without over-thinking
• Controllers or group them under “Controllers” if space is limited
• Utilities like error handling and API features as sub-components of the Express server