How aamir569696/snitch works
This is a buyer-and-seller product marketplace with a React frontend and Express API. The main workflow is seller sign-in, product creation with image upload and persistence, then buyer browsing and viewing product details; sellers can also retrieve their own products. Authentication includes registration, login, session-user lookup, and Google OAuth. The graph includes the documented routes and the sampled controller/storage behavior; frontend API wiring and product-route internals are not sampled, so uncertain connections are omitted.
Main entry points: App.jsx React app · route.js Auth routes · useAuth.js Auth hook · app.js Express app
Components 26
Marketplace frontend
- React app
Frontend/src/App/App.jsx - Page routes
Frontend/src/App/app.route.jsx - Redux store
Frontend/src/App/app.store.js
Authentication
- Login and register
Frontend/src/feature/auth/pages - Auth hook
Frontend/src/feature/auth/Hook/useAuth.js - Auth API client
Frontend/src/feature/auth/services/auth.api.js - Auth state
Frontend/src/feature/auth/state/auth.slice.js
Product workflows
- Product pages
Frontend/src/feature/products/pages - Product hook
Frontend/src/feature/products/Hooks/useProduct.js - Product API client
Frontend/src/feature/products/services/product.api.js - Product state
Frontend/src/feature/products/state/product.slice.js - Product UI
Frontend/src/feature/products/components
Backend API
- Express app
Backend/src/app.js - Auth routes
Backend/src/router/route.js - Product routes
Backend/src/router/product.route.js - Auth controller
Backend/src/controllers/auth.controller.js - Product controller
Backend/src/controllers/product.controller.js - Auth validation
Backend/src/validator/auth.validator.js - Auth middleware
Backend/src/middleware/auth.middleware.js - User model
Backend/src/models/user.model.js - Product model
Backend/src/models/product.model.js - Image upload service
Backend/src/services/storage.service.js
Other components
- Buyer or seller
- MongoDB
- ImageKit
- Google OAuth
Connections 28
- Buyer or seller → React app: uses
- React app → Page routes: renders routes
- React app → Auth hook: loads user
- React app → Redux store: uses state
- Page routes → Login and register: routes to
- Page routes → Product pages: routes to
- Login and register → Auth hook: uses
- Auth hook → Auth API client: requests
- Auth hook → Auth state: dispatches
- Product pages → Product hook: uses
- Product pages → Product UI: renders
- Product hook → Product API client: requests
- Product hook → Product state: dispatches
- Auth API client → Express app: calls API
- Product API client → Express app: calls API
- Express app → Auth routes: mounts
- Express app → Product routes: mounts
- Auth routes → Auth validation: validates
- Auth routes → Auth controller: dispatches
- Auth routes → Auth middleware: authenticates
- Auth middleware → Auth controller: guards
- Auth controller → User model: reads and writes
- Product controller → Product model: reads and writes
- Product controller → Image upload service: uploads images
- Image upload service → ImageKit: uploads
- Auth controller → Google OAuth: uses OAuth
- User model → MongoDB: persists
- Product model → MongoDB: persists