Skip to content

hackathonseries/Supply-Setu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Supply Setu - Supply Chain Management Platform

A comprehensive B2B supply chain management platform that connects suppliers and vendors, enabling efficient surplus exchange, product management, and delivery tracking.

πŸ“‹ Table of Contents

🎯 Overview

Supply Setu is a modern web application designed to streamline supply chain operations between suppliers and vendors. The platform facilitates surplus material exchange, product cataloging, real-time delivery tracking, and comprehensive transaction management.

Core Objectives

  • Connect Suppliers & Vendors: Seamless marketplace for B2B transactions
  • Reduce Waste: Efficient surplus material exchange system
  • Optimize Logistics: Real-time delivery tracking and management
  • Streamline Operations: Comprehensive dashboard for all stakeholders

✨ Features

πŸ” Authentication & User Management

  • Multi-role Authentication: Supplier and Vendor role-based access
  • Secure Login/Register: JWT-based authentication with bcrypt password hashing
  • Profile Management: Comprehensive user profiles with business information
  • Role-based Navigation: Dynamic navigation based on user permissions

πŸͺ Supplier Features

  • Product Catalog Management: Create, edit, and manage product listings
  • Inventory Tracking: Real-time stock quantity monitoring
  • Order Management: Track and manage incoming orders
  • Delivery Creation: Create and manage delivery schedules
  • Analytics Dashboard: Sales performance and order analytics

πŸ›’ Vendor Features

  • Surplus Exchange: Post and browse surplus materials
  • Supplier Marketplace: Browse and order from supplier catalogs
  • Transaction History: Complete transaction tracking
  • Analytics: Business performance insights
  • Real-time Notifications: Order status and surplus booking alerts

πŸ“¦ Delivery & Logistics

  • Real-time Tracking: Live delivery status updates
  • Delivery Logs: Comprehensive delivery history
  • Status Management: Update delivery statuses
  • Route Optimization: Efficient delivery planning

πŸ’³ Payment Integration

  • Razorpay Integration: Secure payment processing
  • Transaction Management: Complete payment history
  • Booking System: Reserve surplus materials and products

πŸ”” Notification System

  • Real-time Alerts: Order status, surplus bookings, delivery updates
  • Email Notifications: Automated email alerts
  • Push Notifications: In-app notification system

πŸ“Š Analytics & Reporting

  • Dashboard Analytics: Performance metrics and insights
  • Transaction Reports: Detailed transaction history
  • Business Intelligence: Data-driven insights for decision making

πŸ›  Technology Stack

Frontend

  • React 19.1.0: Modern React with hooks and functional components
  • Vite: Fast build tool and development server
  • Tailwind CSS: Utility-first CSS framework
  • React Router DOM: Client-side routing
  • Redux Toolkit: State management
  • GSAP: Advanced animations and transitions
  • Axios: HTTP client for API communication

Backend

  • Node.js: JavaScript runtime
  • Express.js: Web application framework
  • MongoDB: NoSQL database
  • Mongoose: MongoDB object modeling
  • JWT: JSON Web Token authentication
  • bcryptjs: Password hashing
  • Multer: File upload handling
  • Nodemailer: Email service
  • Razorpay: Payment gateway integration
  • Node-cron: Scheduled tasks

Development Tools

  • ESLint: Code linting
  • PostCSS: CSS processing
  • Autoprefixer: CSS vendor prefixing

πŸ“ Project Structure

hackathon/
β”œβ”€β”€ backend/                    # Backend API server
β”‚   β”œβ”€β”€ config/                # Configuration files
β”‚   β”‚   β”œβ”€β”€ db.js             # Database configuration
β”‚   β”‚   └── razorpay.js       # Payment gateway config
β”‚   β”œβ”€β”€ controllers/           # Route controllers
β”‚   β”‚   β”œβ”€β”€ authController.js  # Authentication logic
β”‚   β”‚   β”œβ”€β”€ productController.js # Product management
β”‚   β”‚   β”œβ”€β”€ vendorController.js # Vendor operations
β”‚   β”‚   β”œβ”€β”€ supplierController.js # Supplier operations
β”‚   β”‚   β”œβ”€β”€ deliveryController.js # Delivery management
β”‚   β”‚   β”œβ”€β”€ surplusController.js # Surplus exchange
β”‚   β”‚   β”œβ”€β”€ transactionController.js # Transaction handling
β”‚   β”‚   β”œβ”€β”€ paymentController.js # Payment processing
β”‚   β”‚   β”œβ”€β”€ bookingController.js # Booking system
β”‚   β”‚   β”œβ”€β”€ dashboardController.js # Analytics
β”‚   β”‚   β”œβ”€β”€ profileController.js # User profiles
β”‚   β”‚   └── deliveryLogController.js # Delivery logs
β”‚   β”œβ”€β”€ middleware/            # Custom middleware
β”‚   β”‚   └── authMiddleware.js  # JWT authentication
β”‚   β”œβ”€β”€ models/               # Database models
β”‚   β”‚   β”œβ”€β”€ User.js          # User schema
β”‚   β”‚   β”œβ”€β”€ Product.js       # Product schema
β”‚   β”‚   β”œβ”€β”€ SurplusPost.js   # Surplus post schema
β”‚   β”‚   β”œβ”€β”€ Transaction.js   # Transaction schema
β”‚   β”‚   β”œβ”€β”€ Delivery.js      # Delivery schema
β”‚   β”‚   β”œβ”€β”€ Booking.js       # Booking schema
β”‚   β”‚   └── ...              # Other models
β”‚   β”œβ”€β”€ routes/              # API routes
β”‚   β”‚   β”œβ”€β”€ authRoutes.js    # Authentication routes
β”‚   β”‚   β”œβ”€β”€ productRoutes.js # Product routes
β”‚   β”‚   β”œβ”€β”€ vendorRoutes.js  # Vendor routes
β”‚   β”‚   β”œβ”€β”€ supplierRoutes.js # Supplier routes
β”‚   β”‚   β”œβ”€β”€ deliveryRoutes.js # Delivery routes
β”‚   β”‚   β”œβ”€β”€ surplusRoutes.js # Surplus routes
β”‚   β”‚   β”œβ”€β”€ transactionRoutes.js # Transaction routes
β”‚   β”‚   β”œβ”€β”€ paymentRoutes.js # Payment routes
β”‚   β”‚   └── ...              # Other route files
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   β”œβ”€β”€ emailService.js  # Email functionality
β”‚   β”‚   β”œβ”€β”€ expiryScheduler.js # Expiry notifications
β”‚   β”‚   └── dailyBroadcast.js # Daily notifications
β”‚   β”œβ”€β”€ scheduler/           # Scheduled tasks
β”‚   β”‚   └── expiryReminder.js # Expiry reminders
β”‚   └── index.js             # Main server file
β”œβ”€β”€ frontend/                # React frontend application
β”‚   β”œβ”€β”€ public/             # Static assets
β”‚   β”‚   β”œβ”€β”€ logo.png        # Application logo
β”‚   β”‚   β”œβ”€β”€ poster.png      # Marketing materials
β”‚   β”‚   └── ...             # Other assets
β”‚   β”œβ”€β”€ src/                # Source code
β”‚   β”‚   β”œβ”€β”€ Components/     # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx  # Navigation component
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx  # Footer component
β”‚   β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.jsx # Route protection
β”‚   β”‚   β”‚   └── NotificationSystem.jsx # Notifications
β”‚   β”‚   β”œβ”€β”€ context/        # React context
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx # Authentication context
β”‚   β”‚   β”‚   └── useAuth.js  # Auth hook
β”‚   β”‚   β”œβ”€β”€ pages/          # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx    # Landing page
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthPage.jsx # Authentication page
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx # Main dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ Products.jsx # Product catalog
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateProduct.jsx # Product creation
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.jsx # User profile
β”‚   β”‚   β”‚   β”œβ”€β”€ vendor/     # Vendor-specific pages
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Analytics.jsx # Vendor analytics
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddSurplus.jsx # Surplus posting
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SurplusExchange.jsx # Surplus marketplace
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SupplierMarketplace.jsx # Supplier catalog
β”‚   β”‚   β”‚   β”‚   └── TransactionHistory.jsx # Transaction history
β”‚   β”‚   β”‚   └── Supplier/   # Supplier-specific pages
β”‚   β”‚   β”‚       β”œβ”€β”€ Dashboard.jsx # Supplier dashboard
β”‚   β”‚   β”‚       β”œβ”€β”€ CreateDelivery.jsx # Delivery creation
β”‚   β”‚   β”‚       └── Profile.jsx # Supplier profile
β”‚   β”‚   β”œβ”€β”€ api.js          # API configuration
β”‚   β”‚   β”œβ”€β”€ store.js        # Redux store
β”‚   β”‚   └── main.jsx        # Application entry point
β”‚   β”œβ”€β”€ package.json        # Frontend dependencies
β”‚   └── vite.config.ts      # Vite configuration
└── README.md               # Project documentation

πŸš€ Installation & Setup

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (v4.4 or higher)
  • npm or yarn package manager

Backend Setup

  1. Clone the repository

    git clone <repository-url>
    cd hackathon
  2. Install backend dependencies

    cd backend
    npm install
  3. Environment Configuration Create a .env file in the backend directory:

    PORT=5001
    MONGO_URI=mongodb://localhost:27017/surplushub
    JWT_SECRET=your_jwt_secret_key
    RAZORPAY_KEY_ID=your_razorpay_key_id
    RAZORPAY_KEY_SECRET=your_razorpay_secret
    EMAIL_USER=[email protected]
    EMAIL_PASS=your_email_password
  4. Start the backend server

    npm run dev

Frontend Setup

  1. Install frontend dependencies

    cd frontend
    npm install
  2. Environment Configuration Create a .env file in the frontend directory:

    VITE_BACKEND_BASE_URL=http://localhost:5001
  3. Start the frontend development server

    npm run dev

Database Setup

  1. Start MongoDB

    mongod
  2. Create database The application will automatically create the database and collections on first run.

πŸ“š API Documentation

Authentication Endpoints

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/profile - Get user profile
  • PUT /api/auth/profile - Update user profile

Product Endpoints

  • GET /api/products - Get all products
  • POST /api/products - Create new product
  • GET /api/products/:id - Get product by ID
  • PUT /api/products/:id - Update product
  • DELETE /api/products/:id - Delete product

Surplus Endpoints

  • GET /api/surplus - Get all surplus posts
  • POST /api/surplus - Create surplus post
  • GET /api/surplus/:id - Get surplus post by ID
  • PUT /api/surplus/:id - Update surplus post
  • DELETE /api/surplus/:id - Delete surplus post

Transaction Endpoints

  • GET /api/transactions - Get all transactions
  • POST /api/transactions - Create transaction
  • GET /api/transactions/:id - Get transaction by ID
  • PUT /api/transactions/:id - Update transaction status

Delivery Endpoints

  • GET /api/delivery - Get all deliveries
  • POST /api/delivery - Create delivery
  • GET /api/delivery/:id - Get delivery by ID
  • PUT /api/delivery/:id/status - Update delivery status

Payment Endpoints

  • POST /api/payment/create-order - Create payment order
  • POST /api/payment/verify - Verify payment
  • GET /api/payment/history - Get payment history

πŸ‘₯ User Roles & Permissions

Supplier Role

  • Product Management: Create, edit, and manage product listings
  • Inventory Control: Monitor stock levels and update quantities
  • Order Processing: View and process incoming orders
  • Delivery Management: Create and track deliveries
  • Analytics: View sales performance and order analytics

Vendor Role

  • Surplus Exchange: Post and browse surplus materials
  • Marketplace Access: Browse supplier catalogs and place orders
  • Transaction History: View complete transaction records
  • Analytics: Access business performance insights
  • Booking System: Reserve surplus materials and products

πŸ”§ Key Features Breakdown

1. Authentication System

  • JWT-based authentication with secure token management
  • Role-based access control for suppliers and vendors
  • Password hashing using bcrypt for security
  • Session management with automatic token refresh

2. Product Management

  • Comprehensive product catalog with categories and specifications
  • Image upload support for product photos
  • Inventory tracking with real-time stock updates
  • Pricing management with flexible pricing models
  • Product status management (active/inactive)

3. Surplus Exchange System

  • Material posting with expiry dates and pricing
  • Booking system for surplus materials
  • Real-time availability tracking
  • Location-based surplus discovery
  • Automatic expiry notifications

4. Delivery Management

  • Real-time tracking with status updates
  • Delivery logs for complete history
  • Route optimization suggestions
  • Status notifications to all parties
  • Proof of delivery documentation

5. Payment Integration

  • Razorpay integration for secure payments
  • Multiple payment methods support
  • Transaction history with detailed records
  • Payment verification and confirmation
  • Refund processing capabilities

6. Notification System

  • Real-time alerts for order updates
  • Email notifications for important events
  • Push notifications for mobile users
  • Customizable notification preferences
  • Scheduled reminders for expiring items

7. Analytics Dashboard

  • Sales performance metrics
  • Order analytics and trends
  • Inventory insights and recommendations
  • Customer behavior analysis
  • Revenue tracking and reporting

🎨 UI/UX Features

Modern Design

  • Responsive design that works on all devices
  • Clean and professional interface
  • Intuitive navigation with role-based menus
  • Consistent branding throughout the application

Animations & Interactions

  • GSAP animations for smooth transitions
  • Interactive elements with hover effects
  • Loading states for better user experience
  • Smooth scrolling and page transitions

User Experience

  • Role-based dashboards tailored to user needs
  • Quick actions for common tasks
  • Search and filtering capabilities
  • Bulk operations for efficient management

πŸ”’ Security Features

  • JWT authentication with secure token storage
  • Password hashing using bcrypt
  • Input validation and sanitization
  • CORS configuration for API security
  • Rate limiting to prevent abuse
  • Secure file uploads with validation

πŸ“± Responsive Design

The application is fully responsive and optimized for:

  • Desktop computers (1920px and above)
  • Laptops (1366px - 1919px)
  • Tablets (768px - 1365px)
  • Mobile phones (320px - 767px)

πŸš€ Deployment

Backend Deployment

  1. Set up environment variables for production
  2. Configure MongoDB Atlas or production database
  3. Set up SSL certificates
  4. Deploy to platforms like Heroku, AWS, or DigitalOcean

Frontend Deployment

  1. Build the production version: npm run build
  2. Deploy to platforms like Vercel, Netlify, or AWS S3
  3. Configure environment variables for production

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and commit: git commit -m 'Add feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Support

Built with ❀️ by Tech Hustlers

About

SupplySetu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages