A comprehensive full-stack procurement management platform built with modern technologies and AI integration. This platform streamlines the procurement process for organizations with AI-powered vendor evaluation, contract auditing, and intelligent analytics. The system ensures complete data isolation between different admin users and provides role-based access control.
- Procurement Request Management: Create, manage, and track RFPs/RFQs with complete data isolation per admin
- Vendor Management: Vendor profiles, performance tracking, and compliance monitoring
- Quote Management: Quote submission, comparison, and AI-powered evaluation
- AI-Powered Analysis: LangChain integration for automated vendor evaluation and contract auditing
- Contract Management: Contract upload, AI audit, risk assessment, and approval workflow
- Analytics Dashboard: Comprehensive insights and performance metrics
- Real-time Notifications: Live updates and status changes
- Modern UI: Clean, professional design with dark/light mode support
- Responsive Design: Mobile-first approach with smooth animations
- Data Isolation: Complete separation of data between different admin users
- Role-based Access Control: Admin, Procurement Manager, and Vendor roles with proper permissions
- Secure Authentication: JWT-based authentication with refresh tokens
- AI Integration: OpenAI/Gemini powered analysis with structured output
- Database Management: PostgreSQL with Drizzle ORM and proper migrations
- File Management: Secure file upload and storage with Backblaze B2
- Runtime: Node.js with TypeScript
- Framework: Express.js with comprehensive middleware
- Database: PostgreSQL with Drizzle ORM and migrations
- Authentication: JWT with bcryptjs and refresh token rotation
- AI Integration: LangChain with OpenAI/Gemini for structured output
- Validation: Zod schemas for request/response validation
- Logging: Winston with structured logging
- Security: Helmet, CORS, Rate Limiting, Input sanitization
- File Storage: Backblaze B2 for secure file management
- Real-time: Server-Sent Events for live updates
- Framework: Next.js 14 with TypeScript and App Router
- Styling: Tailwind CSS with shadcn/ui components
- State Management: Zustand for global state
- Charts: Recharts for analytics visualization
- Animations: Framer Motion for smooth interactions
- Forms: React Hook Form with Zod validation
- Theme: Next Themes with dark/light mode support
- Notifications: React Hot Toast for user feedback
- HTTP Client: Custom API service with error handling
collaboard/
├── backend/ # Express.js backend
│ ├── src/
│ │ ├── agents/ # AI agents for evaluation and auditing
│ │ ├── controllers/ # Route controllers with data isolation
│ │ ├── db/ # Database schema and connection
│ │ ├── middleware/ # Express middleware (auth, error handling)
│ │ ├── routes/ # API routes with proper access control
│ │ ├── services/ # Business logic services
│ │ ├── types/ # TypeScript definitions
│ │ ├── utils/ # Utility functions
│ │ └── validation/ # Zod validation schemas
│ ├── drizzle/ # Database migrations
│ ├── logs/ # Application logs
│ └── temp/ # Temporary files (gitignored)
├── frontend/ # Next.js frontend
│ ├── src/
│ │ ├── app/ # Next.js app directory with routing
│ │ │ ├── auth/ # Authentication pages
│ │ │ ├── projects/ # Project management pages
│ │ │ ├── settings/ # User settings pages
│ │ │ └── vendor/ # Vendor-specific pages
│ │ ├── components/ # React components
│ │ │ ├── ui/ # Reusable UI components (shadcn/ui)
│ │ │ ├── layout/ # Layout components
│ │ │ ├── projects/ # Project-specific components
│ │ │ └── vendor/ # Vendor-specific components
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # Utility functions and API client
│ │ ├── services/ # Frontend service layer
│ │ └── stores/ # Zustand state management
│ └── public/ # Static assets
├── .gitignore # Git ignore rules for monorepo
├── PRD.md # Product Requirements Document
└── README.md # This file
- Node.js 18+
- PostgreSQL 13+
- npm or yarn
- Backblaze B2 account (for file storage)
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Set up environment variables:
cp env.example .env
# Edit .env with your configuration- Set up the database:
# Generate migrations
npm run db:generate
# Run migrations
npm run db:migrate
# Or push schema directly (development)
npm run db:push- Start the development server:
npm run devThe backend will be available at http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will be available at http://localhost:3000
# Database
DATABASE_URL=postgresql://username:password@localhost:5432/collaboard_db
# JWT Authentication
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=7d
JWT_REFRESH_SECRET=your-super-secret-refresh-key
JWT_REFRESH_EXPIRES_IN=30d
# Server Configuration
PORT=5000
NODE_ENV=development
# CORS Configuration
FRONTEND_URL=http://localhost:3000
# AI Services
OPENAI_API_KEY=your-openai-api-key
GEMINI_API_KEY=your-gemini-api-key
# File Storage (Backblaze B2)
BACKBLAZE_ACCESS_KEY=your-backblaze-access-key
BACKBLAZE_SECRET_KEY=your-backblaze-secret-key
BACKBLAZE_BUCKET_NAME=your-bucket-name
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/refresh- Refresh access tokenPOST /api/auth/logout- Logout userGET /api/auth/profile- Get user profilePUT /api/auth/profile- Update user profile
POST /api/requests- Create procurement requestGET /api/requests- Get requests (filtered by user role and data isolation)GET /api/requests/:id- Get single request (with access control)PUT /api/requests/:id- Update requestDELETE /api/requests/:id- Delete request
POST /api/vendors- Create vendor profileGET /api/vendors- Get all vendorsGET /api/vendors/:id- Get single vendorGET /api/vendors/:id/stats- Get vendor statisticsPUT /api/vendors/:id- Update vendor profilePATCH /api/vendors/:id/block- Block/unblock vendor
POST /api/quotes- Submit quoteGET /api/quotes- Get quotes (filtered by user role and data isolation)GET /api/quotes/:id- Get single quotePUT /api/quotes/:id- Update quotePATCH /api/quotes/:id/withdraw- Withdraw quote
POST /api/contracts- Upload contractGET /api/contracts- Get contracts (filtered by user role and data isolation)GET /api/contracts/:id- Get single contractPUT /api/contracts/:id- Update contractPATCH /api/contracts/:id/approve- Approve contractPATCH /api/contracts/:id/send-to-vendor- Send contract to vendorPATCH /api/contracts/:id/accept- Accept contract (vendor)
POST /api/ai/evaluate-quotes- Run AI quote evaluationPOST /api/ai/evaluate-quotes/stream- Stream AI evaluation resultsPOST /api/ai/audit-contract- Run AI contract auditPOST /api/ai/audit-contract/stream- Stream AI audit resultsGET /api/ai/evaluations/:requestId- Get evaluation history (with access control)GET /api/ai/audits/:contractId- Get audit history (with access control)
GET /api/analytics/dashboard- Get dashboard statisticsGET /api/analytics/vendors/performance- Get vendor performanceGET /api/analytics/spend/category- Get category spend analysisGET /api/analytics/risk/analysis- Get risk analysisGET /api/analytics/insights- Get AI-generated insights
The frontend includes a comprehensive set of reusable UI components built with shadcn/ui:
- Layout Components: Sidebar, Header, Theme Toggle, Navigation
- Dashboard Components: Stats cards, Charts, Data tables, Progress indicators
- Form Components: Inputs, Buttons, Selects, Date Pickers, File uploads
- Data Display: Tables with sorting/filtering, Badges, Progress bars, Charts
- Project Management: Quote management, Contract workflow, Status tracking
- Vendor Interface: Quote submission, Contract acceptance, Performance tracking
- JWT token-based authentication with refresh token rotation
- Role-based access control (Admin, Procurement Manager, Vendor)
- Complete data isolation between different admin users
- Input validation with Zod schemas
- SQL injection prevention with Drizzle ORM
- XSS protection with Helmet
- CORS configuration
- Rate limiting and request throttling
- Password hashing with bcryptjs
- File upload security and validation
The platform integrates with LangChain for structured AI analysis:
- Quote Evaluation: AI-powered analysis of vendor quotes based on cost, delivery, compliance, and terms with detailed scoring
- Contract Auditing: Automated contract risk assessment with missing clause detection and legal compliance checking
- Streaming Results: Real-time streaming of AI analysis results for better user experience
- Structured Output: Consistent AI responses using Zod schemas for reliable data processing
- Real-time dashboard with key procurement metrics
- Vendor performance tracking and scoring
- Category-wise spend analysis and trends
- Risk trend analysis and alerts
- AI-powered insights and recommendations
- Export capabilities for reports (CSV/PDF)
- Data isolation ensuring users only see their own analytics
- Build the application:
npm run build - Set up environment variables
- Run database migrations:
npm run db:migrate - Start the production server:
npm start
- Build the application:
npm run build - Start the production server:
npm start
Both backend and frontend can be containerized using Docker for easy deployment.
npm run testnpm run test- ESLint for code linting
- Prettier for code formatting
- TypeScript for type safety
- Conventional commits for commit messages
- Make changes to schema in
src/db/schema.ts - Generate migration:
npm run db:generate - Apply migration:
npm run db:migrate
- Complete data isolation between admin users
- AI-powered quote evaluation with streaming results
- Contract management with approval workflow
- Real-time notifications and status updates
- Professional UI with dark/light mode support
- Comprehensive error handling and logging
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review the API documentation
- Mobile application
- Advanced AI features and custom models
- Integration with ERP systems
- Multi-language support
- Advanced reporting and analytics
- Workflow automation and approvals
- API for third-party integrations
- Real-time collaboration features
- Advanced contract templates
- Vendor performance scoring system