A full-stack B2B procurement platform that connects buyers and suppliers through a live inventory-driven marketplace with real-time order management.
🔗 Live Backend: https://trustgrid.onrender.com 🎨 Figma Design: View Design 📁 GitHub: ParvSuhagiya/trustGrid
TrustGrid solves the problem of "Which supplier can I actually trust?" by providing a transparent, verified procurement loop:
- Buyers browse the marketplace, view live supplier inventory, and place material requests.
- Suppliers manage their inventory and accept or reject incoming orders.
- Both sides track activity through their respective dashboards.
- 📊 Metrics Dashboard — Live stats: total requests, active orders, completed orders, total spend
- 🏪 Marketplace — Browse all registered suppliers with category, rating, and availability
- 🔍 Supplier Profiles — View live inventory, ratings, reviews, and performance metrics
- 📦 Place Orders — Request specific materials from supplier inventory with quantity validation and real-time budget calculation
- 📋 Orders Page — Track all requests with status:
Pending,Accepted,Rejected - ⭐ Rate Suppliers — Submit feedback after order completion
- 📦 Inventory Management — Add, view, and delete products/supplies with category, quantity, and price
- 📥 Buyer Requests — View all incoming material requests with buyer info and quantity
- ✅ Accept / Reject Orders — Accepting an order automatically deducts inventory quantity
- 📊 Analytics — Inventory analytics cards showing stock health
| Layer | Technology |
|---|---|
| Frontend | React 18 (Vite), Material UI (MUI), React Router v6 |
| Styling | Tailwind CSS v4 + MUI dark theme |
| Backend | Node.js, Express.js v5 |
| Database | MongoDB (Atlas), Mongoose ODM |
| Auth | JWT (JSON Web Tokens), custom crypto (pbkdf2Sync) for password hashing |
| Deployment | Render (backend), Vite dev server (frontend) |
trustGrid/
├── backend/
│ └── src/
│ ├── config/ # MongoDB connection
│ ├── controllers/ # authController, supplierController, inventoryController,
│ │ # requestController, dashboardController, ...
│ ├── middleware/ # authMiddleware (JWT), roleMiddleware (buyer/supplier)
│ ├── models/ # User, Supplier, Supply, Request, Notification, ActivityLog
│ ├── routes/ # authRoutes, supplierRoutes, supplierActionRoutes,
│ │ # requestRoutes, buyerRoutes, dashboardRoutes, ...
│ ├── utils/ # crypto helpers
│ └── server.js # Entry point
│
└── frontend/
└── src/
├── components/
│ ├── BuyerDashboard/ # Marketplace, SupplierProfile, Orders, RateSupplier
│ └── SupplierDashboard/ # Inventory, Orders, Marketplace components
├── context/ # AuthContext (JWT storage + user state)
├── layouts/ # BuyerDashboardLayout, SupplierDashboardLayout (with Outlet)
├── pages/ # BuyerDashboardHome, BuyerMarketplace, SupplierInventory,
│ # SupplierProfilePage, RateSupplierPage, ...
├── utils/ # apiFetch (auth header injection)
└── App.jsx # React Router config with role-based ProtectedRoutes
- Signup/Login returns a JWT token stored in
localStorage - All protected API routes require
Authorization: Bearer <token>header - Two roles:
buyerandsupplier— each sees their own dashboard - Supplier accounts automatically get a public
Supplierprofile on registration
| Method | Endpoint | Access | Description |
|---|---|---|---|
POST |
/api/auth/signup |
Public | Register user (auto-creates Supplier profile if role=supplier) |
POST |
/api/auth/login |
Public | Login and receive JWT |
GET |
/api/suppliers |
Buyer | List all suppliers |
GET |
/api/suppliers/:id |
Buyer | Get supplier profile |
GET |
/api/suppliers/:id/inventory |
Buyer | Get supplier's live inventory |
GET |
/api/supplier/inventory |
Supplier | Get own inventory |
POST |
/api/supplier/inventory |
Supplier | Add inventory item |
DELETE |
/api/supplier/inventory/:id |
Supplier | Remove inventory item |
POST |
/api/requests |
Buyer | Create a material request |
GET |
/api/requests |
Buyer/Supplier | List requests (filtered by role) |
PATCH |
/api/requests/:id/status |
Supplier | Accept/reject a request (deducts inventory) |
GET |
/api/dashboard/metrics |
Buyer | Get live dashboard metrics |
git clone https://github.com/ParvSuhagiya/trustGrid.git
cd trustGridcd backend
npm installCreate a .env file inside /backend:
PORT=5000
MONGO_URI=your_mongodb_atlas_connection_string
JWT_SECRET=your_secret_keyStart the backend:
npm run devcd frontend
npm install
npm run devThe Vite proxy in vite.config.js forwards all /api/* calls to the backend. By default it points to the deployed backend (https://trustgrid.onrender.com). To use your local backend instead, update the proxy target in vite.config.js:
target: 'http://localhost:5000',{ name, email, passwordHash, salt, role: 'buyer' | 'supplier' }
{ userId, name, category, description, rating }
{ supplierId, productName, category, description, quantity, price }
{ buyerId, supplierId, supplyId, productName, quantity, budget,
status: 'pending' | 'accepted' | 'rejected' | 'completed', description }
- 🤖 AI-based supplier recommendations
- 💬 Real-time buyer-supplier chat (Socket.io)
- 📊 Advanced spend analytics with charts
- 🏆 Supplier trust score & ranking leaderboard
- 🚨 Fraud detection system
- 📧 Email notifications for order status updates