Skip to content

Krintox/orderflux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OrderFlux πŸ“¦πŸ”„

Spring Boot Java Next.js TypeScript MongoDB Tailwind CSS


Vercel Koyeb

πŸš€ Overview

OrderFlux is a robust full-stack order management system engineered to streamline the entire order lifecycle between administrators and regional distributors. Built with a modern tech stack featuring Spring Boot (Java) for backend operations and Next.js (TypeScript) for the frontend interface, this application delivers enterprise-grade performance with an intuitive user experience.

✨ Key Features

πŸ” Role-Based Access Control

  • πŸ‘‘ Admin Dashboard

    • Create and assign orders
    • Global visibility across all regions
    • Comprehensive monitoring capabilities
    • System configuration management
  • 🚚 Distributor Portal

    • Region-specific order management
    • Real-time status updates

πŸ”„ Order Lifecycle Management

  • πŸ“ Order Creation - Intelligent form with validation and region assignment
  • 🀝 Acceptance Flow - Distributor order claiming with accountability tracking
  • πŸ“Š Status Pipeline - Granular progression through defined stages:
    Preparing β†’ Printed β†’ Packing β†’ Shipped β†’ Delivered
    

πŸ› οΈ Tech Stack

πŸ”™ Backend Architecture

Spring Boot Architecture

  • Core: Java 17
  • Framework: Spring Boot 3.x
  • Security: Spring Security with JWT authentication
  • Database: MongoDB (document store)
  • Build Tool: Maven

πŸ–₯️ Frontend Implementation

  • Framework: Next.js 14 with App Router
  • Language: TypeScript 5.x
  • Styling: Tailwind CSS with custom components
  • State Management: React Context API + hooks
  • UI Enhancements: React Toastify, React Icons
  • Form Handling: React Hook Form with Zod validation

🚦 Getting Started

Prerequisites

  • Java 17 JDK
  • Node.js 18+ and npm/yarn
  • MongoDB 5.0+
  • Maven 3.8+
  • Git

πŸ”§ Installation

  1. Clone the repository

    git clone https://github.com/Krintox/orderflux.git
    cd orderflux
  2. Backend Setup

    cd backend
    
    # Build and run the application
    mvn clean install
    mvn spring-boot:run
  3. Frontend Setup

    cd frontend
    
    # Install dependencies
    npm install
    
    # Run development server
    npm run dev
  4. Access the application

    • 🌐 Frontend: http://localhost:3000
    • πŸ”Œ Backend API: http://localhost:8080

βš™οΈ Configuration Options

Backend Configuration

# application.properties
spring.data.mongodb.uri=${DB_URI}
spring.data.mongodb.database=orderflux
jwt.secret=${JWT_SECRET}
jwt.expiration=86400000
server.port=8080

πŸ“± Application Workflow

  1. Authentication - Secure login with JWT token generation
  2. Order Creation - Intuitive form with validation and region assignment
  3. Oversight - Comprehensive view of all orders with filtering capabilities
  4. Management - Ability to edit, delete, and track all orders

Distributor Experience

  1. Region-Based Access - View only orders assigned to your region
  2. Order Acceptance - Take ownership of orders with a single click
  3. Status Updates - Move orders through defined stages with validation
  4. Completion - Mark orders as delivered with optional feedback

πŸ”Œ API Reference

Endpoint Method Description Access Control
/api/auth/register POST Register new user account Public
/api/auth/login POST Authenticate and generate JWT Public
/api/orders GET Retrieve all accessible orders Admin: global, Distributor: regional
/api/orders POST Create new order Admin only
/api/orders/{id} GET Get specific order details Owner or Admin
/api/orders/{id} PUT Update order information Owner or Admin
/api/orders/{id} DELETE Remove order from system Admin only
/api/orders/{id}/accept POST Accept responsibility for order Distributor
/api/orders/region/{region} GET Filter orders by region Admin or matching region
/api/orders/status/{status} GET Filter orders by current status Admin only
/api/users/profile GET Get current user details Authenticated
/api/analytics/performance GET Retrieve performance metrics Admin only

πŸ§ͺ Testing

# Backend unit and integration tests
cd backend
mvn test

# Frontend component and integration tests
cd frontend
npm test

πŸš€ Deployment

Backend on Koyeb

# Build the JAR file
cd backend
mvn clean package

# Deploy to Koyeb using their CLI
koyeb app init orderflux-api --docker $PWD/target/orderflux-0.1.0.jar

Frontend on Vercel

# Install Vercel CLI
npm install -g vercel

# Deploy to Vercel
cd frontend
vercel

# For production deployment
vercel --prod

For continuous deployment:

  1. Connect your GitHub repository to Koyeb and Vercel
  2. Configure environment variables in their respective dashboards
  3. Enable automatic deployments on code commits

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure your code follows our style guidelines and includes appropriate tests.

πŸ™ Acknowledgments


Built with ❀️ by Krintox

Koyeb Vercel

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published