Skip to content

ilhanozkan/packaging_supply_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Packaging Supply System

A comprehensive full-stack web application that connects customers with suppliers for packaging needs. Built with NestJS, Next.js, and PostgreSQL, it provides a robust platform for managing order requests and supplier interests.

🎉 Packaging Supply System is live at the following address: https://packaging-supply-system.vercel.app

Overview Videos

Admin:

admin.mov

Customer:

customer.mov

Supplier:

supplier.mov

Architecture

Backend (NestJS)

  • Framework: NestJS with TypeScript
  • Database: PostgreSQL with TypeORM
  • Authentication: JWT-based auth with role-based access control
  • API: RESTful API with comprehensive endpoints

Frontend (Next.js)

  • Framework: Next.js 15 with React 19
  • Styling: Tailwind CSS with custom components
  • State Management: Redux Toolkit
  • UI Components: Radix UI with custom styling
  • Form Handling: React Hook Form with Zod validation

Installation

Environment Variables

Create .env files in both backend and frontend directories with appropriate configuration for your environment. .env.example files are provided as templates.

Backend Setup

Quick Start with Docker

Prerequisites

  • Docker and Docker Compose installed
  1. Clone the repository:

    git clone https://github.com/ilhanozkan/packaging_supply_system.git
    cd packaging_supply_system
  2. Start the backend services:

    cd backend
    docker-compose up -d
  3. The backend will be available at http://localhost:8080

    • API endpoints: http://localhost:8080/api/v1
    • Database: PostgreSQL on port 5432 (in docker network)

Environment Variables

When deploying to production platforms (Heroku, AWS, DigitalOcean, etc.), set the following environment variables:

NODE_ENV=production
PORT=8080
DB_TYPE=postgres
DB_HOST=your-db-host
DB_PORT=5432
DB_USERNAME=your-db-username
DB_PASSWORD=your-db-password
DB_DATABASE=your-db-name
DB_SYNCHRONIZE=false
DB_LOGGING=false
JWT_SECRET=your-super-secret-jwt-key-minimum-32-characters
JWT_EXPIRES_IN=1d

Default Environment (Development)

# Start with default docker-compose.yml (development mode)
$ docker-compose up --build

# Stop the application
$ docker-compose down

Production Environment

# Using production Docker Compose (optimized build)
$ docker-compose -f docker-compose.prod.yml up --build -d

# Stop production environment
$ docker-compose -f docker-compose.prod.yml down

Frontend Setup

  1. Navigate to frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev
  4. Open http://localhost:3000 in your browser

Environment Variables

Create a .env.local file in the frontend directory with the following variables:

NEXT_PUBLIC_API_URL=http://localhost:8080/api/v1

API Endpoints

Authentication

  • POST /api/v1/auth/register - User registration
  • POST /api/v1/auth/login - User login

Order Requests

  • GET /api/v1/order-requests - List all order requests
  • POST /api/v1/order-requests - Create new order request
  • GET /api/v1/order-requests/my-orders - Get user's orders
  • GET /api/v1/order-requests/:id - Get specific order request

Supplier Interests

  • POST /api/v1/supplier-interests - Express interest/submit offer
  • GET /api/v1/supplier-interests/my-interests - Get supplier's interests
  • GET /api/v1/supplier-interests/order-request/:id - Get interests for order

Product Types

  • GET /api/v1/product-types - List active product types
  • GET /api/v1/product-types/all - List all product types (admin)

Admin Endpoints

  • GET /api/v1/admin/users - List all users
  • GET /api/v1/admin/product-types - List all product types

User Roles

  • CUSTOMER: Create order requests, view offers
  • SUPPLIER: Browse orders, submit interests and offers
  • ADMIN: Full system access and management

Database Schema

UML diagram available in the backend/uml/diagram.puml file.

  • Users: Customer, supplier, and admin accounts
  • Order Requests: Packaging requirements from customers
  • Order Items: Specific products within an order
  • Supplier Interests: Supplier responses and offers
  • Product Types: Available packaging categories

License

This project is licensed under the MIT license.

About

A full-stack packaging supply system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages