How tanishq-raj/s8test works
Project type and purpose
• This is a full-stack auction platform (“s8”) with two separate React/Vite frontends—one for bank officers (BankOfficer) and one for regular users/clients (client s8)—and a Node/Express/MongoDB backend (server).
• The two frontends share similar component hierarchies (context providers, dashboards, sign-in, property/auction UIs), and both talk to the same backend over REST endpoints.
File structure
• Top-level directories:
• BankOfficer/ – React code for bank‐officer dashboard
• client s8/ – React code for customer auction pages
• server/ – Express application with routes, controllers, models, middlewares, utils
• Notice MVC-like separation in server/src (models, controllers, routes, middlewares).
• Configuration files: .env, vite.config.js, tailwind.config.js in both frontends; server/src/config/cloudinary.js; utils for email/token.
README
a. Main components
• BankOfficer Frontend (React/Vite + Tailwind)
• Client Frontend (React/Vite + Tailwind)
• API Server (Node.js + Express)
• Database (MongoDB via Mongoose)
• External Services:
– Cloudinary (image storage)
– Email/SMS provider (via utils/sendEmail.js)
– Google OAuth (middleware/googleAuth.js)
b. Relationships & data flows
• Both frontends → HTTP(S) requests → Server REST API
• Server → read/write → MongoDB
• Server → upload/download → Cloudinary
• Server → send email/token → Email provider
• Server ↔ Google OAuth endpoints for social sign-in
c. Architectural patterns & principles
• Frontend: component-based, context providers for global state, separate routes/pages for auction, profile, sign-in
• Backend: MVC (models/controllers/routes), middleware chain (authUser, bankUser, multer for file uploads)
• Security: JWT/email tokens, role-based access (bankUser vs. user)
• Scalability: stateless APIs, external file storage, managed DB
d. Key technologies & libraries
• React, Vite, Tailwind CSS, Context API
• Node.js, Express, dotenv, Mongoose
• Multer (file uploads), Cloudinary SDK
• JSON Web Tokens (sendToken), nodemailer or similar
• Google OAuth strategy