Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

B2B Procurement Platform - Laravel React Application

A comprehensive B2B e-commerce platform facilitating seamless interactions between buyers and suppliers, featuring RFQ management, real-time messaging, order processing, and supplier verification.

πŸ“‹ Overview

This enterprise-grade B2B platform connects buyers with verified suppliers, streamlining the procurement process through a robust set of features including Request for Quotation (RFQ) management, supplier verification, bulk pricing, and real-time communication.

Key Business Value

  • For Buyers: Streamlined procurement, competitive quotes, and transparent supplier interactions
  • For Suppliers: Expanded market reach, efficient quote management, and sales analytics
  • For Admins: Complete oversight, verification controls, and comprehensive reporting

✨ Features

Core Modules

πŸ” Authentication & Authorization

  • Multi-role authentication (Admin, Buyer, Supplier)
  • Email verification and password reset
  • Role-based access control (RBAC)
  • Session management
  • Pending approval state for new suppliers

πŸ“¦ Product Management

  • Comprehensive product catalog with bulk pricing tiers
  • Supplier-specific product listings
  • Stock management and tracking
  • Category-based organization
  • Product approval workflow

πŸ“„ RFQ (Request for Quotation)

  • Create and manage RFQs with detailed specifications
  • Multi-supplier quote submission
  • Quote comparison tools
  • Automated RFQ numbering
  • Status tracking (Open, Quoted, Closed)

πŸ’¬ Messaging System

  • Real-time conversation between buyers and suppliers
  • RFQ-specific communication threads
  • Read/unread message tracking
  • Conversation history
  • Message search functionality

πŸ“Š Order Management

  • Streamlined order creation from accepted quotes
  • Comprehensive order lifecycle (Pending β†’ Confirmed β†’ Processing β†’ Shipped β†’ Delivered)
  • Payment status tracking
  • Order confirmation workflow
  • Invoice generation

πŸ“ˆ Analytics & Reporting

  • Sales analytics for suppliers
  • Buyer purchasing patterns
  • Quote success rates
  • Product performance metrics
  • Financial reporting

Administrative Features

πŸ‘₯ User Management

  • Complete user lifecycle management
  • Role assignment and modification
  • Account activation/deactivation
  • User profile management

βœ… Supplier Verification

  • Document verification workflow
  • Trade license validation
  • Verification status tracking
  • Rejection with reason

πŸ›οΈ Order Oversight

  • Cross-supplier order monitoring
  • Order status management
  • Dispute resolution
  • Payment verification

πŸ“‹ Product Approval

  • New product moderation
  • Price validation
  • Category assignment
  • Quality control

Supplier Features

πŸ“Š Supplier Dashboard

  • Sales performance metrics
  • Quote response rates
  • Active RFQs
  • Recent orders

πŸ’Ό Product Management

  • Bulk price configuration
  • Inventory management
  • Product image uploads
  • Product status control

πŸ“ Quote Management

  • RFQ browsing and filtering
  • Quote submission with product breakdown
  • Quote editing and updates
  • Expired quote handling

Buyer Features

πŸ›’ Buyer Dashboard

  • Active RFQs overview
  • Recent quotes
  • Order status tracking
  • Saved suppliers

πŸ“‹ RFQ Management

  • RFQ creation with product specifications
  • Quote comparison tool
  • Quote acceptance/rejection
  • RFQ status tracking

πŸ—οΈ Architecture

Technology Stack

Backend

  • Framework: Laravel 10.x
  • Database: MySQL 8.0+
  • Authentication: Laravel Sanctum
  • API: RESTful API with API Resources
  • Queue: Redis (for jobs and messaging)

Frontend

  • Framework: React 18.x
  • State Management: React Context API / Redux
  • Routing: React Router v6
  • Styling: Tailwind CSS
  • HTTP Client: Axios
  • Real-time: Laravel Echo with Pusher

Database Schema

Users
β”œβ”€β”€ id (PK)
β”œβ”€β”€ name, email, password
β”œβ”€β”€ role (admin/buyer/supplier)
└── is_active

Suppliers
β”œβ”€β”€ id (PK)
β”œβ”€β”€ user_id (FK)
β”œβ”€β”€ company_name, trade_license
β”œβ”€β”€ verification_status
└── contact information

Products
β”œβ”€β”€ id (PK)
β”œβ”€β”€ supplier_id (FK)
β”œβ”€β”€ name, description
β”œβ”€β”€ base_price, bulk_prices (JSON)
β”œβ”€β”€ stock_quantity
└── status

ProductBulkPrices
β”œβ”€β”€ id (PK)
β”œβ”€β”€ product_id (FK)
β”œβ”€β”€ min_quantity, max_quantity
└── price

RFQs
β”œβ”€β”€ id (PK)
β”œβ”€β”€ rfq_number
β”œβ”€β”€ buyer_id (FK)
β”œβ”€β”€ title, description
β”œβ”€β”€ products_requested (JSON)
└── status

RFQQuotes
β”œβ”€β”€ id (PK)
β”œβ”€β”€ quote_number
β”œβ”€β”€ rfq_id (FK)
β”œβ”€β”€ supplier_id (FK)
β”œβ”€β”€ total_amount
β”œβ”€β”€ product_breakdown (JSON)
└── status

Orders
β”œβ”€β”€ id (PK)
β”œβ”€β”€ order_number
β”œβ”€β”€ buyer_id (FK)
β”œβ”€β”€ supplier_id (FK)
β”œβ”€β”€ rfq_id (FK)
β”œβ”€β”€ total_amount
β”œβ”€β”€ payment_status
└── order_status

OrderItems
β”œβ”€β”€ id (PK)
β”œβ”€β”€ order_id (FK)
β”œβ”€β”€ product_id (FK)
β”œβ”€β”€ product_name
β”œβ”€β”€ quantity, unit_price, total_price
└── (snapshot data)

Messages
β”œβ”€β”€ id (PK)
β”œβ”€β”€ sender_id (FK)
β”œβ”€β”€ receiver_id (FK)
β”œβ”€β”€ rfq_id (FK)
β”œβ”€β”€ message
└── is_read

Carts
β”œβ”€β”€ id (PK)
β”œβ”€β”€ user_id (FK)
β”œβ”€β”€ session_id
β”œβ”€β”€ amounts breakdown
└── shipping information

CartItems
β”œβ”€β”€ id (PK)
β”œβ”€β”€ cart_id (FK)
β”œβ”€β”€ product_id (FK)
β”œβ”€β”€ supplier_id (FK)
β”œβ”€β”€ quantity
└── unit_price

πŸš€ Installation

Prerequisites

  • PHP 8.1+
  • Composer
  • Node.js 18+
  • MySQL 8.0+
  • Redis (optional, for queues)

Backend Setup

# Clone the repository
git clone https://github.com/yourcompany/b2b-platform.git
cd b2b-platform

# Install PHP dependencies
composer install

# Copy environment file
cp .env.example .env

# Configure database in .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=b2b_platform
DB_USERNAME=root
DB_PASSWORD=

# Generate application key
php artisan key:generate

# Run migrations and seeders
php artisan migrate --seed

# Create storage link
php artisan storage:link

# Start development server
php artisan serve

Frontend Setup

# Install NPM dependencies
npm install

# Compile assets for development
npm run dev

# For production
npm run build

Queue Worker (for messaging and notifications)

php artisan queue:work

πŸ“ Project Structure

b2b-platform/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Http/
β”‚   β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ Admin/
β”‚   β”‚   β”‚   β”œβ”€β”€ Auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ Buyer/
β”‚   β”‚   β”‚   └── Supplier/
β”‚   β”‚   └── Middleware/
β”‚   β”œβ”€β”€ Models/
β”‚   └── Services/
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ migrations/
β”‚   └── seeders/
β”œβ”€β”€ resources/
β”‚   └── js/
β”‚       β”œβ”€β”€ Components/
β”‚       β”œβ”€β”€ Layouts/
β”‚       β”œβ”€β”€ Pages/
β”‚       β”‚   β”œβ”€β”€ Admin/
β”‚       β”‚   β”œβ”€β”€ Auth/
β”‚       β”‚   β”œβ”€β”€ Buyer/
β”‚       β”‚   β”œβ”€β”€ Supplier/
β”‚       β”‚   └── Profile/
β”‚       └── app.jsx
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ web.php
β”‚   └── api.php
└── tests/
    β”œβ”€β”€ Feature/
    └── Unit/

πŸ”’ Security Features

  • CSRF Protection: Enabled for all routes
  • XSS Prevention: Input sanitization and output encoding
  • SQL Injection Prevention: Eloquent ORM with parameter binding
  • Authentication: Sanctum tokens with proper expiration
  • Authorization: Policies and gates for all models
  • Rate Limiting: API rate limiting per user role
  • Session Security: Secure session configuration

πŸ§ͺ Testing

# Run all tests
php artisan test

# Run specific test suite
php artisan test --testsuite=Feature
php artisan test --testsuite=Unit

πŸ“Š Performance Optimizations

  • Caching: Redis for session and cache
  • Database Indexing: Optimized indexes for frequent queries
  • Lazy Loading: Prevent N+1 queries with eager loading
  • Pagination: All listings use pagination
  • Asset Minification: Compiled and minified assets
  • Image Optimization: Automatic image resizing and caching

πŸ”„ API Documentation

The API follows RESTful principles with JSON responses. Key endpoints:

Public Endpoints

  • POST /api/login - User authentication
  • POST /api/register - New registration
  • POST /api/forgot-password - Password reset request

Protected Endpoints (require Bearer token)

  • GET /api/buyer/rfqs - List buyer's RFQs
  • POST /api/buyer/rfqs - Create new RFQ
  • GET /api/supplier/quotes - List supplier's quotes
  • POST /api/supplier/quotes - Submit quote
  • GET /api/messages/conversations - List conversations
  • POST /api/messages/send - Send message

πŸ“± Mobile Responsiveness

The frontend is fully responsive and optimized for:

  • Desktop (1200px+)
  • Tablet (768px - 1199px)
  • Mobile (320px - 767px)

🌐 Localization

Currently supports:

  • English (default)
  • Additional languages can be added via Laravel's localization system

πŸ“ˆ Monitoring & Logging

  • Error Tracking: Laravel log files
  • Performance Monitoring: Laravel Telescope (development)
  • User Activity: Activity log model for critical actions

🚦 CI/CD

Example GitHub Actions workflow for testing and deployment:

name: Tests
on: [push, pull_request]
jobs:
    laravel-tests:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - name: Install Dependencies
              run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
            - name: Execute tests
              run: php artisan test

πŸ“„ License

This project is proprietary software owned by [Your Company Name]. All rights reserved.

πŸ‘₯ Contributors

  • [Developer Name] - Lead Developer
  • [Developer Name] - Frontend Specialist
  • [Developer Name] - QA Engineer

πŸ“ž Support

For technical support or inquiries:

πŸ—ΊοΈ Roadmap

Version 2.0 (Q3 2024)

  • Multi-currency support
  • Advanced analytics dashboard
  • API rate limiting improvements
  • Webhook integrations

Version 2.1 (Q4 2024)

  • Mobile applications (iOS/Android)
  • AI-powered quote recommendations
  • Automated supplier matching
  • Blockchain-based contract verification

Built with ❀️ using Laravel and React

About

Enterprise B2B procurement platform built with Laravel and React. It connects buyers and verified suppliers through RFQ management, quote comparison, real-time messaging, and streamlined order processing, providing a complete workflow from product sourcing to order fulfillment.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages