How aadhitiya007/usermanagement works
This is a React/Express storefront with account signup and login, a product catalog, token-protected cart and checkout endpoints, and an admin user-management interface. The admin workflow supports searching and editing users, plus CSV/JSON/PDF import and CSV export; imports are parsed and persisted by the user controller. The sampled cart handlers return order responses without persistent cart or order storage. The README is empty, and frontend product/cart wiring and several page implementations were not sampled, so those connections are omitted.
Main entry points: App.jsx Route app · userRoutes.js User routes · server.js API server · authRoutes.js Auth routes
Components 25
React client
- Route app
my-react-app/frontend/src/App.jsx - Login page
my-react-app/frontend/src/pages/Login.jsx - Signup page
my-react-app/frontend/src/pages/Signup.jsx - User screens
my-react-app/frontend/src/pages/UserTable.jsx - User form
my-react-app/frontend/src/pages/UserForm.jsx - Products page
my-react-app/frontend/src/pages/Products.jsx - Auth service
my-react-app/frontend/src/services/authService.js - User service
my-react-app/frontend/src/services/userService.js
Identity and API
- API server
my-react-app/backend/server.js - Auth routes
my-react-app/backend/routes/authRoutes.js - Auth controller
my-react-app/backend/controllers/authControllers.js - Token verification
my-react-app/backend/middleware/authMiddleware.js
Catalog and cart
- Product routes
my-react-app/backend/routes/productRoutes.js - Product controller
my-react-app/backend/controllers/productControllers.js - Product model
my-react-app/backend/models/product.js - Cart routes
my-react-app/backend/routes/cartRoutes.js - Cart and checkout
my-react-app/backend/controllers/cartControllers.js
User administration
- User routes
my-react-app/backend/routes/userRoutes.js - User operations
my-react-app/backend/controllers/userControllers.js - Admin role check
my-react-app/backend/middleware/roleMiddleware.js - File upload
my-react-app/backend/middleware/upload.js - User model
my-react-app/backend/models/User.js
Other components
- Visitor
- MongoDB
- Browser storage
Connections 28
- Visitor → Route app: uses
- Route app → Login page: routes
- Route app → Signup page: routes
- Route app → User screens: routes
- Route app → User form: routes
- Route app → Products page: routes
- Auth service → Auth routes: HTTP requests
- Auth service → Browser storage: stores claims
- User service → User routes: HTTP requests
- API server → Auth routes: mounts
- API server → Product routes: mounts
- API server → Cart routes: mounts
- API server → User routes: mounts
- API server → MongoDB: connects
- Auth routes → Auth controller: dispatches
- Auth routes → Token verification: verifies logout
- Auth controller → User model: reads and writes
- Token verification → Auth routes: continues requests
- Product routes → Product controller: dispatches
- Product controller → Product model: queries
- Cart routes → Token verification: verifies requests
- Cart routes → Cart and checkout: dispatches
- User routes → Token verification: verifies protected requests
- User routes → Admin role check: checks admin role
- User routes → File upload: handles uploaded files
- User routes → User operations: dispatches
- User operations → User model: queries and updates
- User operations → MongoDB: imports and exports users