A modern, full-featured B2B procurement platform built with Next.js, featuring multiple role-based dashboards, local database integration, and blockchain transaction logging.
- Department Managers: Create and manage procurement needs, track offers and deals
- Suppliers: Browse available needs, submit competitive offers, track performance
- Accountants/Business Leaders: Manage all deals, view financial dashboards, access blockchain explorer
- Admins: Platform oversight, user management, system monitoring
- Role-based authentication with secure password hashing
- Local SQLite database for persistent data storage
- Real-time dashboards with performance metrics
- Advanced charting with Recharts
- Offer management and deal tracking
- Blockchain transaction simulation and explorer
- Responsive design with glassmorphism UI
- Orange gradient theme with modern aesthetics
- Soft orange to bright orange gradient palette (#FFB36B → #FF7A00)
- Rounded cards with glass-effect panels
- Smooth transitions and hover effects
- Mobile-responsive layouts
- Dark mode support
``` app/ ├── auth/ │ ├── login/page.tsx # Login page │ └── signup/page.tsx # Registration page ├── dashboard/ │ ├── department/ │ │ ├── page.tsx # Department dashboard │ │ ├── needs/page.tsx # Needs management │ │ ├── profile/page.tsx # Profile page │ │ └── settings/page.tsx # Settings │ ├── supplier/ │ │ ├── page.tsx # Supplier dashboard │ │ ├── needs/page.tsx # Browse needs │ │ └── profile/page.tsx # Supplier profile │ ├── accountant/ │ │ ├── page.tsx # Financial dashboard │ │ ├── deals/page.tsx # Deal management │ │ ├── database/page.tsx # Database viewer │ │ ├── blockchain/page.tsx # Blockchain explorer │ │ └── ai-summaries/page.tsx # AI insights │ └── admin/ │ ├── page.tsx # Admin dashboard │ ├── users/page.tsx # User management │ └── blockchain/page.tsx # Blockchain view ├── api/ │ └── auth/ │ ├── login/route.ts # Login API │ └── signup/route.ts # Signup API ├── globals.css # Theme & styles └── layout.tsx # Root layout ```
- users: User accounts with roles and authentication
- departments: Department profiles and descriptions
- suppliers: Supplier information and ratings
- needs: Procurement needs from departments
- offers: Supplier offers for needs
- transactions: Completed deals and invoices
- invoices: Invoice records
- blockchain_logs: Blockchain transaction records
- Node.js 18+ installed
- npm or yarn package manager
-
Clone or extract the project ```bash cd supply-sync ```
-
Install dependencies ```bash npm install ```
-
Run development server ```bash npm run dev ```
The application will be available at http://localhost:3000
``` Department Manager: Email: [email protected] Password: password Role: department
Supplier: Email: [email protected] Password: password Role: supplier
Accountant: Email: [email protected] Password: password Role: accountant
Admin: Email: [email protected] Password: password Role: admin ```
The SQLite database (supply_sync.db) is automatically created on first run with all necessary tables and populated with mock data.
The platform uses better-sqlite3 for local database management:
```typescript // Database is initialized automatically // Located at: ./supply_sync.db ```
The application includes comprehensive mock data for:
- Departments with team members
- Suppliers with ratings and services
- Procurement needs
- Offers and transactions
- Blockchain logs
Passwords are securely hashed using the Node.js crypto module with scrypt:
```typescript // Password hashing with salt hashPassword(password: string): string verifyPassword(password: string, hash: string): boolean ```
The platform includes a blockchain simulator for demonstration purposes:
- Transaction ID generation
- Block creation and validation
- Transaction confirmation
- Block explorer interface
POST /api/auth/login- User loginPOST /api/auth/signup- User registration
Edit app/globals.css to customize the orange gradient:
```css --primary: #FF7A00; /* Bright orange / --secondary: #FFB36B; / Soft orange */ ```
Modify lib/db.ts to change database path:
```typescript const dbPath = path.join(process.cwd(), 'your-db-name.db'); ```
For deployment to your private cloud:
-
Prepare the database
- Export the SQLite database
- Use database migration tools for setup
-
Environment Setup
- Configure your server environment
- Set up Node.js runtime
- Install dependencies
-
Database Migration
- Use the schema from
lib/db.ts - Run initialization scripts
- Seed with mock data
- Use the schema from
-
Run the Application ```bash npm run build npm start ```
- Framework: Next.js 16 with App Router
- Database: SQLite (better-sqlite3)
- UI Components: shadcn/ui
- Charts: Recharts
- Styling: Tailwind CSS v4
- Authentication: Custom crypto-based auth
- Fonts: Geist family
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS Safari, Chrome Mobile)
- Server-side rendering for fast page loads
- Optimized images and assets
- Client-side caching with localStorage
- Efficient database queries
- Minimal JavaScript bundle
- Password hashing with salt
- Session token generation
- Role-based access control
- Protected API routes
- Secure credential storage
- Real blockchain integration
- Email notifications
- Advanced analytics
- Payment gateway integration
- Inventory management
- Supply chain tracking
- Advanced search and filters
- User reviews and ratings
For issues or questions:
- Check the mock data in
lib/mock-data.ts - Review database schema in
lib/db.ts - Check API routes in
app/api/ - Verify authentication in
lib/auth.ts
This project is provided as-is for your private cloud deployment.
SupplySync: Connect. Procure. Synchronize.