Skip to content

vatsalgajera-tech/VendorBridge-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VendorBridge AI β€” Smart Procurement ERP

AI-powered procurement and vendor management platform built for modern enterprises. Streamline the entire procurement lifecycle β€” from vendor onboarding and RFQs through quotation comparison, approval workflows, purchase orders, and invoice management.


πŸš€ Features

🏒 Vendor Management

  • Register and manage a complete vendor directory with company profiles
  • Categorize vendors (IT & Software, Hardware, Office Supplies, Logistics, Consulting, Manufacturing)
  • Track vendor ratings, completed orders, delayed orders, and rejection history
  • AI-powered vendor risk scoring based on performance metrics
  • Filter, search, and view detailed vendor profiles
  • Edit and delete vendors with confirmation dialogs

πŸ“‹ RFQ (Request for Quotation) Management

  • Create RFQs with line items (name, quantity, unit, estimated price)
  • Assign multiple vendors to each RFQ
  • Set deadlines and track RFQ status: open β†’ under_review β†’ awarded / cancelled
  • View RFQ details inline with expandable panels
  • Edit and delete RFQs

πŸ“„ Quotation Management

  • Vendors submit quotations against open RFQs
  • Track per-item pricing with unit price and totals
  • Quotation statuses: submitted, under_review, accepted, rejected, expired
  • View all quotations with filtering by status

πŸ† AI Quotation Comparison

  • Side-by-side comparison of all quotations received for an RFQ
  • AI scoring engine ranks vendors on:
    • Price competitiveness
    • Delivery speed
    • Vendor rating and reliability
    • Historical performance (delays, rejections)
  • Auto-recommend the best vendor with justification
  • Accept a quotation directly to auto-create a Purchase Order
  • Sort by overall score, price, or delivery time

βœ… Approval Workflow

  • Multi-stage approval pipeline: Quotation Submitted β†’ Under Review β†’ Manager Approval β†’ Decision Made
  • Pending/Approved/Rejected stats sourced from live API data
  • Managers can approve or reject with remarks
  • Rejection reason captured and stored for audit trail
  • Real-time badge count on Pending tab

πŸ›’ Purchase Orders

  • Auto-generated from accepted quotations
  • PO statuses: pending, confirmed, dispatched, delivered, cancelled
  • View PO details with vendor info, line items, subtotal, tax, and total
  • Filter by status, search by PO number or vendor

🧾 Invoice Management

  • Create invoices linked to Purchase Orders
  • Invoice statuses: draft, sent, paid, overdue, cancelled
  • Clean printable invoice layout with itemized breakdown, GST, and grand total
  • No email/print functionality β€” view-only professional invoice document

πŸ“Š Dashboard

  • At-a-glance stats: Active Vendors, Open RFQs, Pending Approvals, Total PO Value
  • Live counts from API β€” no hardcoded demo data
  • Recent RFQ and Quotation activity feed
  • Procurement health overview

πŸ“ˆ Reports & Analytics

  • Visual summaries of procurement activity
  • Vendor performance breakdowns
  • Spending analytics across categories

πŸ“ Activity Logs

  • System-wide audit trail of all procurement events
  • Timestamped records for compliance and review

πŸ‘₯ Roles & Permissions

Role Access
Admin Full access to all modules
Manager Approvals, RFQs, Quotations, POs, Invoices, Reports
Procurement Officer Vendors, RFQs, Quotations, POs, Invoices, Activity
Vendor Dashboard, RFQs (view), Quotations, POs (view), Invoices (view)

πŸ”‘ Demo Credentials

Role Email Password
Admin vatsal@gmail.com vatsal123
Manager prince@gmail.com prince123
Procurement Officer yash@gmail.com yash123
Vendor neil@gmail.com neil123

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
React 18 UI framework
React Router v6 Client-side routing
Vite Build tool & dev server
Lucide React Icon library
React Hot Toast Notifications
Vanilla CSS Custom design system with dark/light theme

Backend

Technology Purpose
Node.js + Express REST API server
MongoDB + Mongoose Database & ODM
bcryptjs Password hashing
JSON Web Token (JWT) Authentication
dotenvx Environment management

πŸ“ Project Structure

Hackathon-2026/
β”œβ”€β”€ client/                        # React frontend (Vite)
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   β”œβ”€β”€ favicon.svg            # App icon
β”‚   β”‚   β”œβ”€β”€ favicon.jpg            # Logo (globe wireframe)
β”‚   β”‚   └── logo.jpg               # Full brand logo
β”‚   └── src/
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ ConfirmDialog/     # Reusable blur backdrop confirm modal
β”‚       β”‚   └── Layout/            # Sidebar + Header layout shell
β”‚       β”œβ”€β”€ context/
β”‚       β”‚   β”œβ”€β”€ AuthContext.jsx    # JWT auth state
β”‚       β”‚   └── ThemeContext.jsx   # Dark/light theme toggle
β”‚       β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ Auth/              # Login & Signup
β”‚       β”‚   β”œβ”€β”€ Dashboard/         # Overview stats & activity
β”‚       β”‚   β”œβ”€β”€ Vendors/           # Vendor CRUD
β”‚       β”‚   β”œβ”€β”€ RFQ/               # RFQ management
β”‚       β”‚   β”œβ”€β”€ Quotations/        # Quotation list + AI compare
β”‚       β”‚   β”œβ”€β”€ Approvals/         # Approval workflow
β”‚       β”‚   β”œβ”€β”€ PurchaseOrders/    # PO management
β”‚       β”‚   β”œβ”€β”€ Invoices/          # Invoice management
β”‚       β”‚   β”œβ”€β”€ Activity/          # Audit log
β”‚       β”‚   └── Reports/           # Analytics
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   └── api.js             # Axios instance with auth interceptors
β”‚       β”œβ”€β”€ utils/
β”‚       β”‚   └── aiEngine.js        # AI scoring & recommendation logic
β”‚       β”œβ”€β”€ App.jsx                # Routes + Theme + Auth providers
β”‚       └── index.css              # Global design system (dark/light CSS vars)
β”‚
└── server/                        # Express backend
    β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ User.js                # User schema (bcrypt pre-save hook)
    β”‚   β”œβ”€β”€ Vendor.js              # Vendor profile schema
    β”‚   β”œβ”€β”€ RFQ.js                 # Request for Quotation schema
    β”‚   β”œβ”€β”€ Quotation.js           # Vendor quotation schema
    β”‚   β”œβ”€β”€ PurchaseOrder.js       # PO schema (auto tax calc)
    β”‚   β”œβ”€β”€ Invoice.js             # Invoice schema (auto GST calc)
    β”‚   └── Activity.js            # Audit log schema
    β”œβ”€β”€ routes/                    # Express route handlers
    β”œβ”€β”€ middleware/                # Auth middleware (JWT verify)
    β”œβ”€β”€ seed.js                    # Database seeder (wipe + reseed)
    └── index.js                   # Server entry point

βš™οΈ Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)

1. Clone & Install

# Install server dependencies
cd server
npm install

# Install client dependencies
cd ../client
npm install

2. Configure Environment

Create server/.env:

MONGO_URI=mongodb://localhost:27017/vendorbridge
JWT_SECRET=your_super_secret_key
PORT=5000

3. Seed the Database

cd server
node seed.js

This will:

  • Wipe all existing data
  • Create 4 users (admin, manager, procurement officer, vendor)
  • Create 25 vendors across 6 categories
  • Create 12 RFQs with varied statuses
  • Create 33 quotations with multi-vendor responses
  • Create 5 Purchase Orders and 5 Invoices

4. Run the Application

# Terminal 1 β€” Start backend (port 5000)
cd server
npm run dev

# Terminal 2 β€” Start frontend (port 5173)
cd client
npm run dev

Open http://localhost:5173 in your browser.


🎨 Design System

The UI is built with a fully custom CSS design system supporting dark and light themes:

  • Dark mode (default): Deep navy backgrounds (#0c0c14), indigo primary (#6366f1), emerald accent
  • Light mode: Clean white surfaces, rich indigo primary (#4f46e5), proper contrast
  • Toggle between themes using the β˜€οΈ/πŸŒ™ button in the top navigation bar
  • All CSS variables defined in client/src/index.css under :root (dark) and [data-theme="light"]
  • Smooth transitions on theme switch via transition: background/color 300ms ease

πŸ”’ Security

  • Passwords hashed with bcrypt (12 salt rounds) via Mongoose pre-save hook
  • JWT tokens stored in localStorage with role-based route guards
  • Protected routes check role against required permissions before rendering
  • All API requests include Bearer token via Axios interceptor

πŸ€– AI Engine

The utils/aiEngine.js module powers intelligent procurement decisions:

  • Vendor Risk Score β€” Composite score from rating, delivery reliability, rejection rate
  • Quotation Recommendation β€” Multi-factor scoring: price (40%), delivery (25%), vendor score (35%)
  • Best Vendor Suggestion β€” Highlights top-ranked quotation with score breakdown
  • All scoring is deterministic and runs client-side β€” no external API calls

πŸ“Œ Key Design Decisions

  1. Fallback to demo data β€” If the API is unreachable, pages fall back to hardcoded demo fixtures so the UI is always demonstrable
  2. Custom ConfirmDialog β€” All destructive actions (delete vendor, delete RFQ, accept quotation) use a centered modal with blur backdrop instead of window.confirm()
  3. Real stat counts β€” Dashboard and Approvals page stats always reflect live database counts, not static numbers
  4. No email functionality β€” Invoice email sending has been removed; invoices are view/download only

Author

Vatsal Gajera

Packages

 
 
 

Contributors