How bsandeepreddy27/neepco works
Project type and purpose
• This is a full-stack procurement management web application.
• Frontend: React + Vite powered UI for tenders, bidding, payments, reporting, vendor and user management.
• Backend: Node.js + Express REST API implementing MVC (models, controllers, routes, middleware).
• Persistence: PostgreSQL (managed via Supabase migrations).
Main components
a. Frontend (React/Vite)
• Pages and routes (public, auth, dashboard, procurement, payments, reports, vendor management).
• UI layers: PublicLayout, DashboardLayout, AdminDashboardLayout.
• Component libraries and hooks (API wrappers in src/lib/api, auth helpers, UI components).
b. Backend (Node/Express)
• Entry point: server.js
• Controllers (userController, tenderController, bidController, paymentController, vendorController)
• Routes (bidRoutes, userRoutes, tenderRoutes, paymentRoutes, vendorRoutes)
• Middleware (auth, error handling, validation, pagination)
• Models (Sequelize/mapped models or raw SQL via db.js)
• Utilities (Token generation, DB connection)
c. Database
• Supabase-managed PostgreSQL
• Schema defined in supabase/migrations/*.sql
d. External services
• Supabase Auth & Realtime (if used)
• Payment gateway (Stripe or QR code integration)
• Notification service (push/email)
Relationships and data flows
• User’s browser → HTTP(S) → Vite development server (or built assets on web server)
• React app → REST calls → Express API endpoints
• Express controllers → business logic → models → PostgreSQL via db.js
• On critical events (new tender, awarded bid, payment), Express may invoke external services (e.g., email, QR code)
• Supabase migrations only at build/deploy time update schema
Architectural patterns and key principles
• Frontend: component-based, separation of layout vs. page logic, single-page application with client routing (RoleBasedRoute, ProtectedRoute).
• State & data fetching through custom hooks (useAuth) and API client modules (src/lib/api).
• Backend: MVC pattern with clear separation of concerns.
• Middleware pipeline for cross-cutting concerns (authentication, validation, pagination, error handling).
• Token-based authentication (JWT via generateToken.js).
• Database migrations for reproducible schema changes.