Skip to content

microscaler/rerp

Repository files navigation

RERP - Rust Enterprise Resource Planning

Cloud-native, microservices-based ERP system built with Rust and OpenAPI-first architecture

CI License


Executive Summary

RERP (Rust Enterprise Resource Planning) is a next-generation, cloud-native ERP system designed from the ground up for modern enterprises. Built with Rust for performance and reliability, RERP delivers a modular microservices architecture that scales from startups to Fortune 500 companies.

Unlike traditional monolithic ERPs, RERP is architected as 71 independent microservices, each with its own OpenAPI specification, enabling rapid development, independent scaling, and seamless integration. The system follows an OpenAPI-first approach, generating type-safe services automatically from specifications using BRRTRouter.

Key Differentiators

  • 🚀 Cloud-Native: Microservices architecture built for Kubernetes and cloud deployment
  • High Performance: Rust-based services delivering enterprise-grade performance
  • 📐 OpenAPI-First: All services defined in OpenAPI 3.1.0, enabling rapid code generation
  • 🔧 Modular: 71 independent services across 6 implementation phases
  • 🔒 Type-Safe: Auto-generated handlers and types from OpenAPI specs
  • 🌐 API Gateway: System-level BFF specs auto-generated from sub-services

What is RERP?

RERP is a comprehensive Enterprise Resource Planning system that manages all aspects of business operations:

  • Financial Management: Accounting, invoicing, budgeting, financial reporting
  • Sales & CRM: Lead management, quotations, orders, customer relationships
  • Inventory & Logistics: Stock management, warehouse operations, shipping
  • Manufacturing: Production planning, BOM management, quality control
  • Human Resources: Employee records, payroll, recruitment, performance management
  • Project Management: Task tracking, timesheets, resource allocation
  • Marketing & E-commerce: Campaign management, online stores, content management
  • And More: 71 services covering every aspect of enterprise operations

RERP Service Architecture

mindmap
  root((RERP System))
    Phase 1: Core Foundation
      Authentication & Authorization
        IDAM
          Identity Management
          User Management
          Session Management
        RBAC
          Role Management
          Permission Control
          Access Policies
      Infrastructure
        API Gateway
          Request Routing
          Load Balancing
          Rate Limiting
        Integration Platform
          API Integration
          Webhook Management
          Data Transformation
      Product Management
        Catalog
          Product Catalog
          SKU Management
          Category Management
        Pricing
          Dynamic Pricing
          Price Rules
          Discount Management
        Tax
          Tax Calculation
          Tax Rules
          Compliance
    Phase 2: Business Operations
      CRM
        Core CRM
          Lead Management
          Contact Management
          Opportunity Tracking
        Automation
          Workflow Automation
          Email Automation
          Task Automation
        Live Chat
          Chat Management
          Customer Support
          Real-time Communication
      Sales
        Sales Core
          Sales Pipeline
          Sales Forecasting
          Sales Analytics
        Quotation
          Quote Generation
          Quote Management
          Quote Approval
        Order
          Order Processing
          Order Fulfillment
          Order Tracking
        Subscription
          Subscription Management
          Recurring Billing
          Subscription Analytics
        Loyalty
          Loyalty Programs
          Points Management
          Rewards System
      Purchase
        Purchase Core
          Purchase Orders
          PO Approval
          Vendor Management
        Vendor
          Vendor Records
          Vendor Performance
          Vendor Contracts
      Inventory
        Inventory Core
          Stock Management
          Stock Movements
          Stock Valuation
        Warehouse
          Warehouse Operations
          Location Management
          Picking & Packing
        Logistics
          Shipping Management
          Carrier Integration
          Delivery Tracking
        Dropshipping
          Dropshipping Orders
          Supplier Integration
          Inventory Sync
    Phase 3: Financial & HR
      Accounting
        General Ledger
          Chart of Accounts
          Journal Entries
          Account Reconciliation
        Accounts Payable
          Vendor Invoices
          Payment Processing
          AP Aging
        Accounts Receivable
          Customer Invoices
          Payment Collection
          AR Aging
        Invoice
          Invoice Generation
          Invoice Management
          Invoice Templates
        Asset
          Fixed Assets
          Asset Depreciation
          Asset Tracking
        Budget
          Budget Planning
          Budget Tracking
          Budget Reports
        Financial Reports
          P&L Reports
          Balance Sheets
          Cash Flow Reports
        Bank Sync
          Bank Reconciliation
          Transaction Import
          Bank Integration
        EDI
          EDI Processing
          EDI Mapping
          EDI Compliance
      HR
        HR Core
          Employee Records
          Employee Onboarding
          Employee Offboarding
        Payroll
          Payroll Processing
          Salary Management
          Tax Deductions
        Recruitment
          Job Postings
          Applicant Tracking
          Interview Management
        Attendance
          Time Tracking
          Attendance Records
          Shift Management
        Leave
          Leave Requests
          Leave Balance
          Leave Policies
        Appraisal
          Performance Reviews
          Goal Setting
          Feedback Management
        Skills
          Skills Inventory
          Skills Assessment
          Training Management
    Phase 4: Advanced Operations
      Manufacturing
        Manufacturing Core
          Production Orders
          Work Centers
          Production Tracking
        BOM
          Bill of Materials
          BOM Management
          BOM Costing
        Production Planning
          Production Scheduling
          Capacity Planning
          Resource Allocation
        Repair
          Repair Orders
          Repair Tracking
          Warranty Management
        Subcontracting
          Subcontractor Management
          Subcontract Orders
          Quality Control
      Project
        Project Core
          Project Management
          Task Tracking
          Resource Management
        Timesheet
          Time Tracking
          Timesheet Approval
          Project Billing
    Phase 5: Customer-Facing
      Marketing
        Email
          Email Campaigns
          Email Templates
          Email Analytics
        Automation
          Marketing Automation
          Lead Nurturing
          Campaign Management
        Social Media
          Social Integration
          Social Publishing
          Social Analytics
      Website
        CMS
          Content Management
          Page Builder
          Media Library
        Ecommerce
          Online Store
          Shopping Cart
          Checkout Process
        Builder
          Website Builder
          Theme Management
          SEO Tools
      POS
        POS Core
          Point of Sale
          Offline Sales
          Receipt Management
        Payment Gateway
          Payment Processing
          Payment Methods
          Payment Security
      Helpdesk
        Helpdesk Core
          Ticket System
          Ticket Routing
          SLA Management
        Knowledge Base
          Knowledge Articles
          FAQ Management
          Search & Discovery
      Field Service
        Field Service Core
          Service Scheduling
          Technician Dispatch
          Service History
    Phase 6: Extensions
      Marketplace
        Marketplace Core
          App Marketplace
          Third-Party Apps
          App Management
        Integration Hub
          Integration Management
          Connector Library
          Integration Monitoring
      Analytics
        BI
          Business Intelligence
          Data Warehousing
          OLAP Cubes
        Dashboards
          Custom Dashboards
          Widget Library
          Real-time Updates
        Reporting
          Report Builder
          Scheduled Reports
          Report Distribution
    Additional Services
      AI
        AI Core
          AI Models
          Machine Learning
          Predictive Analytics
        Document AI
          Document Processing
          OCR & Extraction
          Document Intelligence
      Automation
        Workflow Automation
          Process Automation
          Rule Engine
          Event Triggers
      Appointments
        Appointment Scheduling
          Calendar Management
          Booking System
          Reminders
      Approvals
        Approval Workflows
          Approval Chains
          Approval Rules
          Approval Tracking
      Data
        Data Cleaning
          Data Quality
          Data Validation
          Data Enrichment
      Documents
        Document Management
          Document Storage
          Version Control
          Document Sharing
      ESG
        ESG Compliance
          Sustainability Tracking
          ESG Reporting
          Compliance Management
      IoT
        IoT Integration
          Device Management
          Data Collection
          Real-time Monitoring
      Localization
        Localization Core
          Multi-language Support
          Currency Management
          Regional Settings
        Compliance
          Regulatory Compliance
          Tax Compliance
          Legal Compliance
Loading

Architecture

RERP follows a microservices architecture where each business function is an independent service:

flowchart TD
    Gateway["API Gateway Layer<br/>(System-level BFF specs auto-generated)"]
    
    Accounting["Accounting Services<br/>(9 services)"]
    Sales["Sales Services<br/>(5 services)"]
    HR["HR Services<br/>(7 services)"]
    
    Common["Common Services<br/>(Auth, Infrastructure)"]
    
    Gateway --> Accounting
    Gateway --> Sales
    Gateway --> HR
    
    Accounting --> Common
    Sales --> Common
    HR --> Common
    
    style Gateway fill:#e1f5ff,stroke:#01579b,stroke-width:3px
    style Accounting fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
    style Sales fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px
    style HR fill:#fff3e0,stroke:#e65100,stroke-width:2px
    style Common fill:#fce4ec,stroke:#880e4f,stroke-width:2px
Loading

Each service:

  • Has its own OpenAPI 3.1.0 specification
  • Can be developed, deployed, and scaled independently
  • Follows the same patterns (generated + implementation crates)
  • Integrates via well-defined APIs

Why RERP?

The Problem with Traditional ERPs

Traditional ERP systems suffer from:

  • Monolithic Architecture: Single codebase makes updates risky and slow
  • Vendor Lock-in: Proprietary systems create dependency and high costs
  • Poor Performance: Legacy codebases struggle with modern workloads
  • Complex Integration: Difficult to connect with modern SaaS tools
  • High Costs: Licensing fees, implementation costs, and maintenance overhead
  • Slow Innovation: Large codebases resist rapid feature development

How RERP Solves This

Traditional ERP RERP
Monolithic codebase ✅ 71 independent microservices
Proprietary APIs ✅ OpenAPI-first, open standards
Slow deployments ✅ Independent service deployments
Vendor lock-in ✅ Open source, self-hostable
Complex integrations ✅ RESTful APIs, webhooks, event-driven
High licensing costs ✅ Open source, no per-user fees
Legacy technology ✅ Modern Rust, cloud-native

Business Benefits

  • Cost Savings: No licensing fees, reduced infrastructure costs through efficient Rust services
  • Flexibility: Deploy only the services you need, scale independently
  • Speed: Rapid development through OpenAPI code generation
  • Reliability: Rust's memory safety and performance reduce downtime
  • Future-Proof: Cloud-native architecture adapts to changing needs
  • Integration: API-first design enables seamless connections with modern tools

How RERP Works

OpenAPI-First Development

RERP uses an OpenAPI-first development approach:

  1. Define API: Write OpenAPI 3.1.0 specification for each service
  2. Generate Code: Use BRRTRouter to generate handlers, types, and routing
  3. Implement Logic: Add business logic in implementation crates
  4. Deploy: Each service runs independently

Service Structure

Each RERP service follows a consistent structure:

components/
├── {system}/
│   ├── {module}/              # Generated crate (from OpenAPI)
│   │   ├── Cargo.toml
│   │   ├── doc/
│   │   │   └── openapi.yaml    # Service OpenAPI spec
│   │   └── src/                # Auto-generated code
│   └── {module}_impl/          # Implementation crate
│       ├── Cargo.toml
│       ├── config/
│       │   └── config.yaml
│       └── src/
│           ├── main.rs         # Service entry point
│           └── controllers/   # Business logic

Development Workflow

# 1. Define OpenAPI spec
vim openapi/accounting/general-ledger/openapi.yaml

# 2. Generate service code
cd components/accounting/general-ledger
brrtrouter-gen --spec ../../openapi/accounting/general-ledger/openapi.yaml

# 3. Implement business logic
vim ../general-ledger_impl/src/controllers/accounts.rs

# 4. Build and test
cargo build -p rerp_accounting_general_ledger_impl
cargo test

Auto-Generated BFF Specs

System-level Backend for Frontend (BFF) specs are automatically generated:

# Regenerate all system BFF specs from sub-services
python3 scripts/generate_system_bff.py

This aggregates all sub-service paths and schemas into unified system APIs, automatically kept in sync via GitHub Actions.


Project Status

Current Phase: Foundation & Specification

  • 71 Services Defined: Complete OpenAPI specifications with paths and schemas
  • Crate Structure: 142 crates organized in Rust workspace (71 generated + 71 implementation)
  • BFF Generation: Auto-generated system-level API gateway specs
  • CI Automation: GitHub Actions for automatic BFF spec generation
  • Code Generation: Services ready for BRRTRouter code generation
  • Implementation: Business logic implementation in progress

Implementation Phases

RERP is organized into 6 implementation phases:

  1. Phase 1: Core Foundation (7 services) - Auth, infrastructure, product management
  2. Phase 2: Business Operations (14 services) - CRM, sales, purchase, inventory
  3. Phase 3: Financial & HR (16 services) - Accounting, HR management
  4. Phase 4: Advanced Operations (7 services) - Manufacturing, project management
  5. Phase 5: Customer-Facing (10 services) - Marketing, website, POS, helpdesk
  6. Phase 6: Extensions (5 services) - Marketplace, analytics, BI

See RERP_MUSINGS.md for detailed module breakdown and market analysis.


Quick Start

Prerequisites

  • Rust toolchain (stable)
  • Python 3.12+ (for generation scripts)
  • BRRTRouter (for code generation)

Explore the Project

# Clone the repository
git clone https://github.com/microscaler/rerp.git
cd rerp

# View service specifications
ls openapi/*/openapi.yaml

# Check crate structure
ls components/*/

# Generate system BFF specs
python3 scripts/generate_system_bff.py

Generate a Service

# Navigate to a service
cd components/accounting/general-ledger

# Generate code from OpenAPI spec
brrtrouter-gen --spec ../../openapi/accounting/general-ledger/openapi.yaml

# Build the service
cargo build

Project Structure

rerp/
├── components/              # Rust workspace with all service crates
│   ├── Cargo.toml          # Workspace configuration
│   ├── {system}/           # System directories
│   │   ├── {module}/       # Generated crate
│   │   └── {module}_impl/  # Implementation crate
│   └── common/             # Shared utilities
├── openapi/                # OpenAPI specifications
│   ├── {system}/           # System directories
│   │   ├── openapi.yaml    # Auto-generated BFF spec
│   │   ├── README.md       # System documentation
│   │   └── {module}/       # Service directories
│   │       ├── openapi.yaml # Service OpenAPI spec
│   │       └── README.md     # Service documentation
├── scripts/                 # Generation and automation scripts
│   ├── generate_system_bff.py
│   └── generate_complete_openapi.py
└── .github/
    └── workflows/
        └── generate-bff-specs.yml  # CI automation

Documentation

Core Documentation

User-Facing Documentation

All user-facing project documentation is located in the docs/ directory:

Architecture Decision Records

  • docs/adrs/ - Architecture Decision Records (ADRs)

Contributing

RERP is in active development. We welcome contributions from developers at all levels!

See CONTRIBUTING.md for:

  • Getting started as a contributor
  • Development workflow and guidelines
  • Code standards and best practices
  • Testing requirements
  • Areas for contribution

Technology Stack

  • Language: Rust (for performance and safety)
  • Framework: BRRTRouter (OpenAPI-first HTTP router)
  • API Specification: OpenAPI 3.1.0
  • Architecture: Microservices, cloud-native
  • Deployment: Kubernetes-ready, containerized services

Roadmap

  • Define 71 service specifications
  • Create crate structure (142 crates)
  • Generate OpenAPI specs with paths and schemas
  • Set up system-level BFF generation
  • Implement CI automation
  • Generate code from OpenAPI specs
  • Implement core services (Phase 1)
  • Add comprehensive testing
  • Deploy to cloud infrastructure
  • Build community and ecosystem

License

Licensed under either of:

at your option.


Community & Support


Acknowledgments

RERP is inspired by:

  • Odoo: Comprehensive modular ERP approach
  • ERPNext: Open-source ERP philosophy
  • BRRTRouter: OpenAPI-first development methodology

Built with ❤️ using Rust and open-source principles.

About

musings on an erp

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published