How vallabhpatil3078/claimdesk works
Main Components
a. Frontend (React + Tailwind)
b. Backend API (Node.js + Express + Passport)
c. Database (MongoDB via Mongoose)
d. Cloud Storage (Cloudinary)
e. External Auth Providers (Google, Facebook, Apple)
f. Email Service (Nodemailer, SMTP)
Relationships & Data Flows
• User’s Browser ←→ React App (client/ folder)
• Pages & Components fetch/send data via a centralized api.js service.
• AuthContext manages JWT tokens in localStorage.
• React App —[HTTPS REST]→ Express Server (server/server.js)
• Routes: /auth, /items, /users, /notifications
• Middleware: authMiddleware (JWT), passport (OAuth), multer (file upload), roleMiddleware (admin checks)
• Express Server —[Mongoose]→ MongoDB
• Models: User, Items, SendMails
• Express Server —[Cloudinary SDK]→ Cloudinary
• Upload/serve item images.
• Express Server —[Passport OAuth]→ External Providers
• Redirects for Google/Facebook/Apple login flows.
• Express Server —[Nodemailer/SMTP]→ User Email Inbox
• Verification emails, password resets via generateEmailToken.
Architectural Patterns
• MVC-style layering on backend:
• Routes → Controllers → Models → Database
• RESTful API boundary between frontend and backend
• Client-side state management using React Context
• Token-based auth (JWT) + OAuth strategies via Passport.js
• Separation of concerns: configuration (server/config), utilities (server/utils), middleware (server/middleware)