Skip to content

Daredevil124/ECO_FLOW_Odoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

87 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ ECO_FLOW_Odoo - Product Lifecycle Management System

A comprehensive Engineering Change Order (ECO) & Version Master Data Management system built with modern technologies for manufacturing and product development teams.


πŸ“‹ Table of Contents


🎯 Overview

ECO_FLOW_Odoo is a PLM (Product Lifecycle Management) tool that manages changes to Products and Bills of Materials (BoMs) through a controlled workflow. It enforces a strict Propose β†’ Approve β†’ Apply process to prevent direct edits to master data.

Core Problem Solved

  • ❌ No direct edits to master product data
  • βœ… Centralized change management
  • βœ… Complete audit trails
  • βœ… Role-based access control
  • βœ… Version control with versioning

✨ Key Features

Feature Description
πŸ”’ Role-Based Access Control Engineering, Approver, Operations, Admin roles with granular permissions
πŸ“ ECO Workflow Management Propose β†’ Review β†’ Approve β†’ Apply with state machine
πŸ“¦ Product Versioning Automatic version management with active/archived states
πŸ§ͺ Bill of Materials (BoM) Hierarchical BoM structure with component validation
πŸ‘οΈ Diff Visualization Side-by-side comparison with color-coded changes
πŸ“Š Audit Trail Complete history of all changes with timestamps
πŸ”„ Redis Caching Fast session management and active master data caching
🐳 Docker Deployment Containerized backend and frontend with Docker Compose

πŸ—οΈ Architecture

High-Level System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     CLIENT LAYER                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  React Frontend (Vite + Tailwind CSS + React Router) β”‚   β”‚
β”‚  β”‚  β€’ Product Dashboard  β€’ BoM Editor                   β”‚   β”‚
β”‚  β”‚  β€’ ECO Management    β€’ Diff Visualization            β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↑
                    HTTP/REST API (JSON)
                              ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   APPLICATION LAYER                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚       Go Backend (Gin Framework + JWT Auth)          β”‚   β”‚
β”‚  β”‚  β€’ API Handlers    β€’ Services    β€’ Middleware        β”‚   β”‚
β”‚  β”‚  β€’ ECO Engine      β€’ Validation  β€’ Authorization     β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↑
                    Database Connections
                              ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   DATA LAYER                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   PostgreSQL DB        β”‚  β”‚   Redis Cache/PubSub     β”‚   β”‚
β”‚  β”‚  β€’ Products            β”‚  β”‚  β€’ Sessions              β”‚   β”‚
β”‚  β”‚  β€’ BoMs                β”‚  β”‚  β€’ Active Master Data    β”‚   β”‚
β”‚  β”‚  β€’ ECOs                β”‚  β”‚  β€’ User Permissions      β”‚   β”‚
β”‚  β”‚  β€’ Audit Logs          β”‚  β”‚  β€’ Temp Storage          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ System Workflow

ECO (Engineering Change Order) Process

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   NEW ECO    β”‚  User creates ECO (Draft Product/BoM clone)
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  USER EDITS DRAFT                    β”‚  
β”‚  (Master data untouched)             β”‚
β”‚  β€’ Modify Product Details            β”‚
β”‚  β€’ Update BoM Components             β”‚
β”‚  β€’ Attach Files                      β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  SUBMIT FOR REVIEW                   β”‚
β”‚  ECO Status: IN REVIEW               β”‚
β”‚  (Approvers notified)                β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                                 β”‚
       ↓                                 ↓
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ APPROVED β”‚                    β”‚ REJECTED β”‚
   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”˜
        β”‚                               β”‚
        β”‚ (Return to DRAFT)             β”‚
        β”‚ for re-edit β†β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        ↓
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  APPLY TO PRODUCTION                β”‚
   β”‚  *** Transaction ***                β”‚
   β”‚  β€’ Archive old version              β”‚
   β”‚  β€’ Activate new version             β”‚
   β”‚  β€’ Log to Audit Trail               β”‚
   β”‚  β€’ Notify Oper ations                β”‚
   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          ↓
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  APPLIED & LIVE  β”‚
   β”‚  (Available to   β”‚
   β”‚   Operations)    β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow: Product Lifecycle

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    MASTER DATA STATE                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

INITIAL STATE:
  Product v1 (ACTIVE) β†’ Used by Operations
       ↓
       Approver sees active version in read-only

ECO CREATED:
  Product v1 (ACTIVE) ──┐
                        β”œβ†’ ECO clones v1 β†’ v1-DRAFT
  Approver creates      β”‚
                        β””β†’ Engineering edits v1-DRAFT

ECO APPROVED & APPLIED:
  Product v1 (ARCHIVED) ← Old version archived
  Product v2 (ACTIVE)   ← New version activated
       ↓
       Operations now fetch v2 automatically

πŸ’» Technology Stack

Backend

  • Language: Go (Golang)
  • Framework: Gin Web Framework
  • Authentication: JWT (JSON Web Tokens)
  • Database: PostgreSQL 12+
  • Caching: Redis
  • Validation: Custom middleware & service layer

Frontend

  • Framework: React 18+ (with Vite bundler)
  • Styling: Tailwind CSS 3+
  • Routing: React Router v6
  • State Management: React Context API
  • HTTP Client: Axios/Fetch API
  • UI Components: Custom + Tailwind

Infrastructure

  • Containerization: Docker
  • Orchestration: Docker Compose
  • Reverse Proxy: Nginx
  • Environment: Linux containers

DevOps & Tools

  • Version Control: Git
  • Database Migrations: SQL scripts
  • Environment Configuration: .env files

πŸ“ Project Structure

ECO_FLOW_Odoo/
β”œβ”€β”€ backend/                          # Go backend API
β”‚   β”œβ”€β”€ cmd/
β”‚   β”‚   β”œβ”€β”€ api/                      # API server entrypoint
β”‚   β”‚   β”‚   └── main.go
β”‚   β”‚   └── migrate/                  # Database migration tool
β”‚   β”‚       └── main.go
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”œβ”€β”€ config/                   # Configuration management
β”‚   β”‚   β”‚   └── config.go
β”‚   β”‚   β”œβ”€β”€ database/                 # DB & Redis connection
β”‚   β”‚   β”‚   β”œβ”€β”€ database.go
β”‚   β”‚   β”‚   └── redis.go
β”‚   β”‚   β”œβ”€β”€ handlers/                 # HTTP request handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ auth_handler.go       # Login/Register
β”‚   β”‚   β”‚   β”œβ”€β”€ product_handler.go    # Product endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ bom_handler.go        # BoM endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ eco_handler.go        # ECO endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ operation_handler.go  # Operations endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ audit_handler.go      # Audit log endpoints
β”‚   β”‚   β”‚   └── middleware.go         # Auth & logging middleware
β”‚   β”‚   β”œβ”€β”€ models/                   # Data structures
β”‚   β”‚   β”‚   └── models.go
β”‚   β”‚   β”œβ”€β”€ repositories/             # Database queries
β”‚   β”‚   β”‚   β”œβ”€β”€ product_repo.go
β”‚   β”‚   β”‚   β”œβ”€β”€ bom_repo.go
β”‚   β”‚   β”‚   β”œβ”€β”€ eco_repo.go
β”‚   β”‚   β”‚   β”œβ”€β”€ operation_repo.go
β”‚   β”‚   β”‚   β”œβ”€β”€ audit_repo.go
β”‚   β”‚   β”‚   └── user_repo.go
β”‚   β”‚   └── services/                 # Business logic
β”‚   β”‚       β”œβ”€β”€ auth_service.go
β”‚   β”‚       β”œβ”€β”€ product_service.go
β”‚   β”‚       β”œβ”€β”€ bom_service.go
β”‚   β”‚       β”œβ”€β”€ eco_service.go        # ECO workflow engine
β”‚   β”‚       β”œβ”€β”€ operation_service.go
β”‚   β”‚       β”œβ”€β”€ diff_service.go       # Diff computation
β”‚   β”‚       └── email_service.go      # Notifications
β”‚   β”œβ”€β”€ migrations/                   # Database migration scripts
β”‚   β”‚   β”œβ”€β”€ 001_initial_schema.sql
β”‚   β”‚   β”œβ”€β”€ 002_add_username.sql
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ go.mod                        # Go module dependencies
β”‚   β”œβ”€β”€ main.go                       # (if exists)
β”‚   └── Dockerfile                    # Container image for backend
β”‚
β”œβ”€β”€ frontend/                         # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/               # Reusable React components
β”‚   β”‚   β”œβ”€β”€ context/                  # React Context providers
β”‚   β”‚   β”œβ”€β”€ pages/                    # Page components
β”‚   β”‚   β”œβ”€β”€ services/                 # API client services
β”‚   β”‚   β”œβ”€β”€ App.jsx                   # Root component
β”‚   β”‚   β”œβ”€β”€ main.jsx                  # React entry point
β”‚   β”‚   └── index.css                 # Global styles
β”‚   β”œβ”€β”€ package.json                  # NPM dependencies
β”‚   β”œβ”€β”€ vite.config.js                # Vite configuration
β”‚   β”œβ”€β”€ tailwind.config.js            # Tailwind CSS setup
β”‚   β”œβ”€β”€ postcss.config.js             # PostCSS configuration
β”‚   β”œβ”€β”€ index.html                    # HTML template
β”‚   β”œβ”€β”€ nginx.conf                    # Nginx reverse proxy config
β”‚   └── Dockerfile                    # Container image for frontend
β”‚
β”œβ”€β”€ docker-compose.yaml               # Multi-container orchestration
β”œβ”€β”€ ECOFlow_Feature_Spec.md           # Detailed feature specification
β”œβ”€β”€ TEST_DATA_EXAMPLES.md             # Sample test data
└── README.md                         # This file

πŸš€ Getting Started

Prerequisites

  • Docker & Docker Compose (recommended)
  • Go 1.18+ (if running locally without Docker)
  • Node.js 16+ (if running frontend locally)
  • PostgreSQL 12+ (if not using Docker)

Quick Start with Docker

  1. Clone the repository:

    git clone https://github.com/yourusername/ECO_FLOW_Odoo.git
    cd ECO_FLOW_Odoo
  2. Create environment file:

    cp .env.example .env
    # Edit .env with your configuration
  3. Start the application:

    docker-compose up -d
  4. Run database migrations:

    docker-compose exec backend ./migrate
  5. Access the application:

    • Frontend: http://localhost:3000
    • API: http://localhost:8080
    • API Docs: http://localhost:8080/docs (if enabled)

Local Development

Backend Setup:

cd backend
go mod download
go run cmd/api/main.go

Frontend Setup:

cd frontend
npm install
npm run dev

πŸ‘₯ User Roles & Permissions

Role Create ECO Edit Draft Submit for Review Approve/Reject Apply Change View Active View Drafts
Engineering User βœ… βœ… βœ… ❌ ❌ βœ… βœ… (Own)
Approver ❌ ❌ ❌ βœ… βœ… βœ… βœ… (All)
Operations User ❌ ❌ ❌ ❌ ❌ βœ… ❌
Admin βœ… βœ… βœ… βœ… βœ… βœ… βœ…

πŸ—„οΈ Database Schema

Key Tables

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      users              β”‚       β”‚    products          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (PK)                 β”‚       β”‚ id (PK)              β”‚
β”‚ email                   β”‚       β”‚ name                 β”‚
β”‚ username                β”‚       β”‚ version              β”‚
β”‚ password_hash           β”‚       β”‚ is_active            β”‚
β”‚ full_name               β”‚       β”‚ is_archived          β”‚
β”‚ role                    β”‚       β”‚ sale_price           β”‚
β”‚ created_at              β”‚       β”‚ cost_price           β”‚
β”‚ updated_at              β”‚       β”‚ created_at           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚ updated_at           β”‚
                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           ↑                                ↑
           └──── (FK: created_by) β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      ecos                β”‚     β”‚   bom_headers          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (PK)                  β”‚     β”‚ id (PK)                β”‚
β”‚ eco_number               β”‚     β”‚ product_id (FK)        β”‚
β”‚ type (Product/BoM)       β”‚     β”‚ product_version        β”‚
β”‚ status                   β”‚     β”‚ version                β”‚
β”‚ submitted_by (FK)        β”‚     β”‚ is_active              β”‚
β”‚ approved_by (FK)         β”‚     β”‚ is_archived            β”‚
β”‚ draft_data (JSON)        β”‚     β”‚ created_at             β”‚
β”‚ created_at               β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ applied_at               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                 β”‚   bom_lines            β”‚
                                 β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                                 β”‚ id (PK)                β”‚
                                 β”‚ bom_header_id (FK)     β”‚
                                 β”‚ component_id (FK)      β”‚
                                 β”‚ quantity               β”‚
                                 β”‚ work_center            β”‚
                                 β”‚ manufacturing_time     β”‚
                                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    audit_logs            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (PK)                  β”‚
β”‚ action (CREATE/UPDATE)   β”‚
β”‚ table_name               β”‚
β”‚ record_id                β”‚
β”‚ old_data (JSON)          β”‚
β”‚ new_data (JSON)          β”‚
β”‚ changed_by (FK: users)   β”‚
β”‚ timestamp                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‘ API Endpoints

Authentication

POST   /api/auth/login          # User login
POST   /api/auth/register       # User registration
POST   /api/auth/logout         # User logout
GET    /api/auth/me             # Get current user

Products

GET    /api/products            # List active products
GET    /api/products/:id        # Get product details
GET    /api/products/:id/versions  # Get all versions

Bill of Materials

GET    /api/boms                # List active BoMs
GET    /api/boms/:id            # Get BoM details
GET    /api/boms/:id/components # Get BoM components

Engineering Change Orders

POST   /api/ecos                # Create new ECO
GET    /api/ecos                # List ECOs
GET    /api/ecos/:id            # Get ECO details
PUT    /api/ecos/:id/draft      # Update ECO draft
POST   /api/ecos/:id/submit     # Submit for review
POST   /api/ecos/:id/approve    # Approve ECO
POST   /api/ecos/:id/reject     # Reject ECO
POST   /api/ecos/:id/apply      # Apply ECO to production
GET    /api/ecos/:id/diff       # Get diff visualization

Audit & Compliance

GET    /api/audit               # Get audit logs
GET    /api/audit/:table/:id    # Get history for record

πŸ” Security Features

  • βœ… JWT Authentication - Secure token-based auth
  • βœ… Role-Based Access Control - Middleware-enforced permissions
  • βœ… Audit Trails - All changes logged with user & timestamp
  • βœ… Transaction Safety - ECO apply uses DB transactions
  • βœ… Input Validation - Server-side validation on all endpoints
  • βœ… CORS Configuration - Restricted cross-origin requests
  • βœ… Password Hashing - bcrypt hashing for passwords
  • βœ… Environment Secrets - .env for sensitive config

Code Standards

  • Go: Follow Go conventions, use gofmt
  • JavaScript: Use ES6+, follow Airbnb style guide
  • Commits: Use conventional commits (feat:, fix:, docs:, etc.)

--

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages