How nishalkc/scatch works
Scatch is a marketplace web application for browsing and listing products, with account registration/login and a cart. The main workflow loads the user and product catalogue in the React app, lets users browse shops, categories, offers and product details, and sends listing or cart actions to Express routes and controllers. The backend uses user and product models, cookie-based authentication, and image-upload configuration. The source index and excerpts support the main wiring; some unsampled page behavior and database connection details are not verified here.
Main entry points: App.jsx App and routing · Api.jsx HTTP client · ProductCard.jsx Product card · Shop.jsx Shop page
Components 28
Web application
- App and routing
client/src/App.jsx - Navigation bar
client/src/components/Navbar.jsx - Account sidebar
client/src/components/SideBar.jsx - Create listing
client/src/pages/CreateProducts.jsx - Listing form
client/src/components/Form.jsx - HTTP client
client/src/services/Api.jsx
Product discovery
- Home page
client/src/pages/Home.jsx - Home showcase
client/src/components/Hero.jsx - Shop page
client/src/pages/Shop.jsx - Category page
client/src/pages/ProductsBYCategory.jsx - Offers page
client/src/pages/OfferProducts.jsx - Product details
client/src/pages/ProductDetails.jsx - Product loader
client/src/components/ProductLoader.jsx - Product card
client/src/components/ProductCard.jsx
Accounts
- Login page
client/src/pages/Login.jsx - Registration page
client/src/pages/Register.jsx - Profile page
client/src/pages/Profile.jsx
API and domain
- Express app
server/app.js - User routes
server/routes/userRoutes.js - Product routes
server/routes/productsRoutes.js - Auth controller
server/controllers/authcontroller.js - Product controller
server/controllers/productscontroller.js - Auth middleware
server/middleware/authmiddleware.js - User model
server/models/user.js - Product model
server/models/products.js - Image upload config
server/config/multer.js - Cloudinary config
server/config/cloudinary.js
Other components
- Shopper / seller
Connections 44
- Shopper / seller → App and routing: uses
client/src/App.jsx - App and routing → Navigation bar: renders
client/src/App.jsx - App and routing → Account sidebar: renders
client/src/App.jsx - App and routing → Home page: routes to
client/src/App.jsx - App and routing → Shop page: routes to
client/src/App.jsx - App and routing → Category page: routes to
client/src/App.jsx - App and routing → Offers page: routes to
client/src/App.jsx - App and routing → Product details: routes to
client/src/App.jsx - App and routing → Create listing: routes to
client/src/App.jsx - App and routing → Login page: routes to
client/src/App.jsx - App and routing → Registration page: routes to
client/src/App.jsx - App and routing → Profile page: routes to
client/src/App.jsx - Home page → Home showcase: renders
client/src/pages/Home.jsx - Home showcase → Product card: renders
client/src/components/Hero.jsx - Shop page → Account sidebar: uses
client/src/pages/Shop.jsx - Shop page → Product card: renders
client/src/pages/Shop.jsx - Shop page → Product loader: renders
client/src/pages/Shop.jsx - Offers page → Product loader: renders
client/src/pages/OfferProducts.jsx - Category page → Product loader: renders
client/src/pages/ProductsBYCategory.jsx - Product details → Product card: uses
client/src/pages/ProductDetails.jsx - Product loader → Product card: renders
client/src/components/ProductLoader.jsx - Create listing → Listing form: renders
client/src/pages/CreateProducts.jsx - App and routing → HTTP client: loads user and products
client/src/App.jsx - Login page → HTTP client: sends auth requests
client/src/pages/Login.jsx - Registration page → HTTP client: sends registration
client/src/pages/Register.jsx - Create listing → HTTP client: submits listing
client/src/pages/CreateProducts.jsx - Product details → HTTP client: requests product
client/src/pages/ProductDetails.jsx - Category page → HTTP client: requests category
client/src/pages/ProductsBYCategory.jsx - Product card → HTTP client: adds to cart
client/src/components/ProductCard.jsx - Account sidebar → HTTP client: logs out
client/src/components/SideBar.jsx - HTTP client → Express app: HTTP requests
- Express app → User routes: mounts
server/app.js - Express app → Product routes: mounts
server/app.js - User routes → Auth controller: dispatches
server/routes/userRoutes.js - User routes → Auth middleware: protects profile
server/routes/userRoutes.js - Product routes → Product controller: dispatches
server/routes/productsRoutes.js - Product routes → Auth middleware: protects routes
server/routes/productsRoutes.js - Product routes → Image upload config: configures upload
server/routes/productsRoutes.js - Auth controller → User model: reads and writes
server/controllers/authcontroller.js - Auth controller → User model: issues token for
server/controllers/authcontroller.js - Auth middleware → User model: loads user
server/middleware/authmiddleware.js - Product controller → Product model: reads and writes
server/controllers/productscontroller.js - Product controller → User model: updates owner
server/controllers/productscontroller.js - Image upload config → Cloudinary config: uses config
server/config/multer.js