How mitul1927/shipease works
1. ShipEase is split into two top-level applications: a Node.js backend API in Backend/ and a React single-page frontend in Frontend/. The architecture is a classic client–server split, with the frontend consuming backend routes over HTTP.
2. The backend is organized around an API layering pattern: routes define endpoints, controllers hold request handling logic, models define the persisted domain objects, and middleware.js centralizes cross-cutting request protection. This keeps routing, business logic, and data access separated.
3. The backend’s core domain objects are user and Shipment. Those models imply that the application’s main data flow is around authenticated users creating, viewing, and managing shipment records.
4. Authentication is handled as a dedicated subsystem. authRoutes and authController cover sign-up/login flows, while config/passport.js indicates Passport-based auth strategy support. middleware.js likely enforces route guards for authenticated or role-restricted requests.
5. Shipment management is its own backend vertical, exposed through shipmentRoutes and shipmentController. This is where shipment creation, retrieval, and possibly status updates or filtering would be orchestrated before reaching the model layer.
6. There is an explicit admin surface on the backend via adminRoutes. Combined with the separate AdminLogin page on the frontend, this suggests role-based access boundaries between normal users and administrators.
7. utils/cloudinaryConfig.js shows an external media/storage integration. That means some shipment or user workflows likely involve image/file uploads, with Cloudinary acting as the offloaded asset service rather than storing binaries in the app itself.
8. The frontend is a Vite-built React app. src/main.jsx bootstraps the app, App.jsx provides the top-level shell, and routers/routes.jsx defines client-side navigation between pages. This means page transitions are handled in-browser, not by full server renders.
9. Frontend state is managed with Redux in reduxStore/, specifically authSlice2.js and store.js. Authentication state is therefore shared globally across pages like login, signup, dashboard, and shipment creation.
10. The page structure reflects the product flows: public entry points (Home, Login, Signup, AdminLogin), shipment actions (AddShipment, AllShipments), and authenticated user areas under Dashboard/ (myShipments, userInfo). The dashboard is a secondary layout with its own navigation component (Dashboardnav.jsx).
11. Shared UI is kept in reusable components such as Header, Footer, and a small ui/button primitive. This indicates a componentized frontend where layout chrome is separated from feature pages.
12. Deployment/build tooling is standard for a modern React app: Vite for frontend bundling, and a separate frontend vercel.json for deployment configuration. The backend has its own package.json, so it is independently runnable and deployable from the frontend.
13. In diagram terms, the main flow is: browser users interact with React routes and Redux state, the frontend calls backend REST endpoints, backend controllers validate/authenticate through middleware and Passport, then read/write shipment and user records, with Cloudinary used for any uploaded assets.
Main entry points: routes.jsx Routes · App.jsx App shell · Dashboard.jsx Dashboard · shipmentRoutes.js Shipment routes
Components 31
Backend
Node.js API and domain logic
- Server · Bootstraps the API process
Backend/server.js - Auth routes · Sign-up and login endpoints
Backend/routes/authRoutes.js - Shipment routes · Shipment CRUD endpoints
Backend/routes/shipmentRoutes.js - Admin routes · Administrator-facing endpoints
Backend/routes/adminRoutes.js - User routes · User-facing endpoints
Backend/routes/userRoutes.js - Auth controller · Handles authentication request logic
Backend/controllers/authController.js - Shipment controller · Coordinates shipment workflows
Backend/controllers/shipmentController.js - User controller · Handles user-related requests
Backend/controllers/userController.js - Middleware · Cross-cutting request protection
Backend/middleware.js - Passport config · Passport-based authentication setup
Backend/config/passport.js - User model · Persisted user domain object
Backend/models/user.js - Shipment model · Persisted shipment domain object
Backend/models/Shipment.js - Cloudinary · Offloaded asset storage integration
Backend/utils/cloudinaryConfig.js
Frontend
React single-page app
- Main · React app bootstrap
Frontend/src/main.jsx - App shell · Top-level frontend layout
Frontend/src/App.jsx - Routes · Browser-side page navigation
Frontend/src/routers/routes.jsx - Redux store · Global application state
Frontend/src/reduxStore/store.js - Auth state · Shared authentication state
Frontend/src/reduxStore/authSlice2.js - Home · Public landing page
Frontend/src/pages/Home/Home.jsx - Login · User sign-in page
Frontend/src/pages/Login/login.jsx - Signup · User registration page
Frontend/src/pages/Signup/Signup.jsx - Admin login · Administrator sign-in page
Frontend/src/pages/AdminLogin/AdminLogin.jsx - Dashboard · Authenticated user area
Frontend/src/pages/Dashboard/Dashboard.jsx - Dashboard nav · Dashboard-specific navigation
Frontend/src/pages/Dashboard/Dashboardnav.jsx - My shipments · User shipment list view
Frontend/src/pages/Dashboard/myShipments/MyShipments.jsx - User info · Profile and account view
Frontend/src/pages/Dashboard/userInfo/UserInfo.jsx - Add shipment · Shipment creation flow
Frontend/src/pages/AddShipment/AddShipment2.jsx - All shipments · Shipment listing page
Frontend/src/pages/AllShipments/AllShipments.jsx - Header · Global page header
Frontend/src/components/Header.jsx - Footer · Global page footer
Frontend/src/components/Footer.jsx - Button · Reusable button component
Frontend/src/components/ui/button.jsx
Connections 41
- Main → App shell: boots · Entry point renders the app shell
- App shell → Routes: uses · Shell delegates navigation to client routes
- Routes → Home: routes to · Public landing route
- Routes → Login: routes to · Login route
- Routes → Signup: routes to · Signup route
- Routes → Admin login: routes to · Admin login route
- Routes → Dashboard: routes to · Authenticated area
- Routes → Add shipment: routes to · Shipment creation route
- Routes → All shipments: routes to · Shipment listing route
- Dashboard → Dashboard nav: contains · Dashboard layout includes its own navigation
- Dashboard → My shipments: contains · Dashboard shows user shipments
- Dashboard → User info: contains · Dashboard shows account details
- App shell → Header: uses · Shared chrome
- App shell → Footer: uses · Shared chrome
- App shell → Button: uses · Shared UI primitive
- App shell → Redux store: connects · App is wired to global state
- Redux store → Auth state: includes · Auth state is centralized in Redux
- Login → Redux store: reads/writes · Login updates shared auth state
- Signup → Redux store: reads/writes · Signup updates shared auth state
- Dashboard → Redux store: reads · Authenticated views consume auth state
- Add shipment → Shipment routes: calls · Frontend submits shipment requests to the API
- Login → Auth routes: calls · User login talks to auth endpoints
- Signup → Auth routes: calls · User registration talks to auth endpoints
- Admin login → Admin routes: calls · Admin login talks to admin surface
- All shipments → Shipment routes: calls · Listing view consumes shipment endpoints
- Dashboard → User routes: calls · Dashboard requests user data
- Server → Auth routes: mounts · Server wires in auth routes
- Server → Shipment routes: mounts · Server wires in shipment routes
- Server → Admin routes: mounts · Server wires in admin routes
- Server → User routes: mounts · Server wires in user routes
- Auth routes → Auth controller: delegates · Route handlers forward to controller logic
- Shipment routes → Shipment controller: delegates · Route handlers forward to shipment logic
- User routes → User controller: delegates · Route handlers forward to user logic
- Admin routes → Middleware: guards · Admin access is protected by shared middleware
- Auth controller → Passport config: uses · Authentication relies on Passport configuration
- Auth controller → User model: reads/writes · Auth flow persists user records
- User controller → User model: reads/writes · User endpoints operate on users
- Shipment controller → Shipment model: reads/writes · Shipment workflows persist shipment records
- Shipment controller → Cloudinary: uses · Uploads are offloaded to Cloudinary
- Shipment routes → Middleware: guards · Shipment endpoints are protected
- User routes → Middleware: guards · User endpoints are protected