How utsav-patell/googlesolutions_backend_public works
Project type and purpose
• This is a single‐service Node.js/Express RESTful backend API for an e-waste marketplace.
• Its primary purpose is to handle user authentication, admin operations, listings of electronic waste, reviews, and transaction management.
File structure
• Top‐level files:
• app.js – application entry point, sets up Express, loads routes & middleware
• package.json – dependencies (Express, Mongoose, Redis, etc.)
• env_format.txt – environment variable template
• src/config – database (MongoDB via Mongoose), Redis cache, temp settings
• src/controllers – HTTP handlers for each domain (auth, user, admin, e-waste, review, transaction)
• src/routes/api – routers that map URL paths to controllers
• src/models – Mongoose schemas (users, admin, organizations, e-waste listings, reviews, transactions)
• src/middlewares – authentication, role‐based access, input‐validation error handling, ownership checks
• src/services / src/utils – auxiliary functions (token generation, email/OTP workflows, Redis utilities, password hashing)
• src/validators – request‐payload validation logic
Insights from README
• Local setup instructions: uses nodemon to launch app.js
• API documentation hosted on Postman (defines endpoints and payloads)