How abdelrahman-ali769/e-commerce-project works
This is an Express/Mongoose e-commerce REST API. Clients send requests through app.js and resource routers; route middleware validates and authorizes requests before controllers perform authentication, account self-service, or catalogue operations. Controllers use Mongoose models for persistence, with shared CRUD and query helpers for catalogue lists. The documented product also includes image processing and email-based password recovery. Some router and controller wiring is supported by the README or SOURCE INDEX rather than sampled implementation excerpts, so uncertain links are omitted.
Main entry points: app.js Express Application · Routers Catalogue Routes · FactoyHandlers.cjs CRUD Handlers · ProductController.cjs Product Operations
Components 22
HTTP API
- Express Application
app.js - Auth Routes
Routers/AuthRouter.cjs - Catalogue Routes
Routers - User Routes
Routers/UserRouter.cjs
Identity and Accounts
- Authentication
Controllers/AuthController.cjs - Account Operations
Controllers/UserController.cjs - User Model
Models/UserSchema.cjs
Catalogue Management
- Category Operations
Controllers/CategoryController.cjs - Subcategory Operations
Controllers/SubCategoryConstroller.cjs - Brand Operations
Controllers/BrandController.cjs - Product Operations
Controllers/ProductController.cjs - Category Model
Models/CategorySchema.cjs - Subcategory Model
Models/SubCategorySchema.cjs - Brand Model
Models/BrandSchema.cjs - Product Model
Models/ProductSchema.cjs
Shared Runtime Services
- CRUD Handlers
Controllers/FactoyHandlers.cjs - Query Features
utils/ApiFeatures.cjs - Image Upload
middlewares/ImageMiddleware.cjs - Request Validation
middlewares/validatorMiddleware.cjs - MongoDB
.config/DataBaseConnection.cjs - SMTP Email
Other components
- API Client
Connections 27
- API Client → Express Application: sends requests
README.md - Express Application → MongoDB: connects to
app.js - Express Application → Auth Routes: mounts routes
app.js - Express Application → Catalogue Routes: mounts routes
app.js - Express Application → User Routes: mounts routes
app.js - Auth Routes → Authentication: dispatches to
Routers/AuthRouter.cjs - User Routes → Authentication: checks access
Routers/UserRouter.cjs - User Routes → Account Operations: dispatches to
Routers/UserRouter.cjs - Authentication → User Model: reads and writes
Controllers/AuthController.cjs - Authentication → SMTP Email: sends reset email
Controllers/AuthController.cjs - Account Operations → User Model: reads and writes
Controllers/UserController.cjs - Catalogue Routes → Category Operations: dispatches to
README.md - Catalogue Routes → Subcategory Operations: dispatches to
README.md - Catalogue Routes → Brand Operations: dispatches to
README.md - Catalogue Routes → Product Operations: dispatches to
README.md - Category Operations → Category Model: queries
Controllers/CategoryController.cjs - Subcategory Operations → Subcategory Model: queries
Controllers/SubCategoryConstroller.cjs - Brand Operations → Brand Model: queries
Controllers/BrandController.cjs - Product Operations → Product Model: queries
Controllers/ProductController.cjs - Category Operations → CRUD Handlers: delegates CRUD
Controllers/CategoryController.cjs - Subcategory Operations → CRUD Handlers: delegates CRUD
Controllers/SubCategoryConstroller.cjs - Brand Operations → CRUD Handlers: delegates CRUD
Controllers/BrandController.cjs - Product Operations → CRUD Handlers: delegates CRUD
Controllers/ProductController.cjs - CRUD Handlers → Query Features: applies list queries
Controllers/FactoyHandlers.cjs - Product Operations → Image Upload: uploads images
Controllers/ProductController.cjs - Account Operations → Image Upload: uploads images
Controllers/UserController.cjs - Product Model → Category Model: populates category
Models/ProductSchema.cjs