Future ERP Vision
Project Vision
Goal: Build a modern, full-featured ERP system to replace the legacy .NET ERP.
Phases:
- Phase 1 (Complete): Read-only data access + data models, CLI tool
- Phase 2: Backend REST API (read-write support)
- Phase 3: CLI enhancements (full CRUD)
- 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)
| Component | Technology | Purpose |
|---|---|---|
| Web Framework | Axum 0.7+ | HTTP routing, middleware |
| Async Runtime | Tokio 1.0+ | Standard Rust async runtime |
| Database | SQLx 0.7+ or SeaORM | Compile-time SQL checking / Full ORM |
| Auth | jsonwebtoken + argon2 | JWT + password hashing |
| API Docs | utoipa 4.0+ | Auto-generated OpenAPI docs |
| Logging | tracing | Structured logging |
| Validation | validator | Input validation |
Frontend (Planned)
| Component | Technology |
|---|---|
| Framework | React 19 + TypeScript |
| Build Tool | Vite 7.0+ |
| UI Library | Ant Design 6.x |
| Server State | TanStack Query 5 |
| Client State | Zustand |
| Router | React Router 7 |
| CSS | Tailwind 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
| Metric | Target |
|---|---|
| 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