Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Future ERP Vision

Project Vision

Goal: Build a modern, full-featured ERP system to replace the legacy .NET ERP.

Phases:

  1. Phase 1 (Complete): Read-only data access + data models, CLI tool
  2. Phase 2: Backend REST API (read-write support)
  3. Phase 3: CLI enhancements (full CRUD)
  4. Phase 4: Web frontend

Complete Architecture Design

Target Architecture: DDD + Clean Architecture

┌─────────────────────────────────────────────────────────────┐
│                        Presentation Layer                    │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐      │
│  │   Web UI     │  │   REST API   │  │   CLI Tool   │      │
│  │  (React)     │  │   (Axum)     │  │   (Clap)     │      │
│  └──────────────┘  └──────────────┘  └──────────────┘      │
└─────────────────────────────────────────────────────────────┘
                            ↓
┌─────────────────────────────────────────────────────────────┐
│                      Application Layer                       │
│  • Use Cases (Application Services)                          │
│  • DTOs (Data Transfer Objects)                              │
│  • Validation & Authorization                                │
└─────────────────────────────────────────────────────────────┘
                            ↓
┌─────────────────────────────────────────────────────────────┐
│                        Domain Layer                          │
│  • Entities (Aggregates)                                     │
│  • Domain Services                                           │
│  • Repository Interfaces (Traits)                            │
│  • Domain Events                                             │
└─────────────────────────────────────────────────────────────┘
                            ↓
┌─────────────────────────────────────────────────────────────┐
│                    Infrastructure Layer                      │
│  • Database (SQL Server / PostgreSQL)                        │
│  • Caching (Redis)                                           │
│  • Message Queue (optional)                                  │
│  • External Services (email, payments)                       │
└─────────────────────────────────────────────────────────────┘

Tech Stack (Planned)

Backend (Rust)

ComponentTechnologyPurpose
Web FrameworkAxum 0.7+HTTP routing, middleware
Async RuntimeTokio 1.0+Standard Rust async runtime
DatabaseSQLx 0.7+ or SeaORMCompile-time SQL checking / Full ORM
Authjsonwebtoken + argon2JWT + password hashing
API Docsutoipa 4.0+Auto-generated OpenAPI docs
LoggingtracingStructured logging
ValidationvalidatorInput validation

Frontend (Planned)

ComponentTechnology
FrameworkReact 19 + TypeScript
Build ToolVite 7.0+
UI LibraryAnt Design 6.x
Server StateTanStack Query 5
Client StateZustand
RouterReact Router 7
CSSTailwind CSS 4

Database Migration Path

  • Short-term: Continue with SQL Server (add read-write support)
  • Mid-term: Prepare PostgreSQL migration
  • Long-term: Fully migrate to PostgreSQL (open source, better Rust ecosystem support)

Phase 2: Backend API

Estimated duration: 2-3 months

Milestone 1: Foundation (2 weeks)

  • Application Layer setup (use cases, DTOs, validation)
  • Migrate from Tiberius to SQLx/SeaORM
  • Read-write transaction support
  • Connection pool configuration

Milestone 2: API Server (4 weeks)

  • Axum server with route structure
  • Middleware (Auth, Logging, CORS, Rate Limiting)
  • JWT authentication + RBAC
  • Core Product APIs (CRUD)

Milestone 3: Business Modules (6 weeks)

  • Orders API (CRUD + status workflow + fulfillment)
  • Warehouse API (stock management + transfers)
  • Customers API (CRM features)
  • Finance API (invoicing + payments)

Milestone 4: Testing & Documentation (2 weeks)

  • Unit tests (>80% coverage)
  • Integration tests
  • OpenAPI documentation
  • Deployment setup

Phase 4: Web Frontend

Estimated duration: 3-4 months

  • Infrastructure setup (React 19 + Vite + Ant Design)
  • Core features: Login, Dashboard, Product/Order/Warehouse management
  • Advanced features: Real-time updates, file uploads, PDF generation, Excel import/export

Performance Targets

MetricTarget
API response time (P95)<100ms
API throughput>1000 req/s
Frontend initial load<2s
Lighthouse score>90
Test coverage>80%

Security Design

  • JWT with refresh tokens
  • Role-Based Access Control (RBAC)
  • HTTPS only (TLS 1.3)
  • Parameterized SQL queries
  • CSRF protection
  • Rate limiting
  • Audit logging

Roadmap Summary

Q1 2026: Phase 2 - Backend API
Q2 2026: Phase 3 - CLI Enhancements
Q3-Q4 2026: Phase 4 - Web Frontend

Created: 2026-02-05 | Status: Draft for Review