Skip to content

fa-ezzahra/supply-sync-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SupplySync - B2B Procurement Platform

A modern, full-featured B2B procurement platform built with Next.js, featuring multiple role-based dashboards, local database integration, and blockchain transaction logging.

Features

Multi-Role Support

  • 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

Core Features

  • 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

Design Highlights

  • 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

Project Structure

``` 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 ```

Database Schema

Tables

  • 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

Getting Started

Prerequisites

  • Node.js 18+ installed
  • npm or yarn package manager

Installation

  1. Clone or extract the project ```bash cd supply-sync ```

  2. Install dependencies ```bash npm install ```

  3. Run development server ```bash npm run dev ```

The application will be available at http://localhost:3000

Demo Credentials

``` 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 ```

Database Setup

The SQLite database (supply_sync.db) is automatically created on first run with all necessary tables and populated with mock data.

Using with Local Database

The platform uses better-sqlite3 for local database management:

```typescript // Database is initialized automatically // Located at: ./supply_sync.db ```

Mock Data

The application includes comprehensive mock data for:

  • Departments with team members
  • Suppliers with ratings and services
  • Procurement needs
  • Offers and transactions
  • Blockchain logs

Authentication

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 ```

Blockchain Simulation

The platform includes a blockchain simulator for demonstration purposes:

  • Transaction ID generation
  • Block creation and validation
  • Transaction confirmation
  • Block explorer interface

API Routes

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/signup - User registration

Customization

Theme Colors

Edit app/globals.css to customize the orange gradient:

```css --primary: #FF7A00; /* Bright orange / --secondary: #FFB36B; / Soft orange */ ```

Database Location

Modify lib/db.ts to change database path:

```typescript const dbPath = path.join(process.cwd(), 'your-db-name.db'); ```

Deployment to Private Cloud

For deployment to your private cloud:

  1. Prepare the database

    • Export the SQLite database
    • Use database migration tools for setup
  2. Environment Setup

    • Configure your server environment
    • Set up Node.js runtime
    • Install dependencies
  3. Database Migration

    • Use the schema from lib/db.ts
    • Run initialization scripts
    • Seed with mock data
  4. Run the Application ```bash npm run build npm start ```

Technologies Used

  • 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

Browser Support

  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+
  • Mobile browsers (iOS Safari, Chrome Mobile)

Performance Features

  • Server-side rendering for fast page loads
  • Optimized images and assets
  • Client-side caching with localStorage
  • Efficient database queries
  • Minimal JavaScript bundle

Security Features

  • Password hashing with salt
  • Session token generation
  • Role-based access control
  • Protected API routes
  • Secure credential storage

Future Enhancements

  • Real blockchain integration
  • Email notifications
  • Advanced analytics
  • Payment gateway integration
  • Inventory management
  • Supply chain tracking
  • Advanced search and filters
  • User reviews and ratings

Support & Maintenance

For issues or questions:

  1. Check the mock data in lib/mock-data.ts
  2. Review database schema in lib/db.ts
  3. Check API routes in app/api/
  4. Verify authentication in lib/auth.ts

License

This project is provided as-is for your private cloud deployment.


SupplySync: Connect. Procure. Synchronize.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •