Skip to content

Foundry

High-performance, open-source multi-system backend framework & admin control plane built with Rust, Axum, and React. Framework and user applications are completely decoupled.

⚡ Next-Gen Rust Backend Framework · Decoupled Subsystem Architecture

bash — foundry CLI v0.1.0
# 1. Install CLI from GitHub repository
cargo install --git https://github.com/foundkit/foundry foundry_cli
# 2. Scaffold a brand-new independent user application (PostgreSQL default, or --db mysql / mariadb / mongodb)
foundry new my-app
✔Created independent application project: my-app/
# 3. Enter project directory & run (auto-initializes schema & superadmin)
cd my-app && cargo run
✔Foundry Application listening on http://0.0.0.0:8080
✔REST APIs available at /api/v1
✔Admin Shell connected at /admin

Framework & Application Separation

Foundry is distributed as a Cargo dependency (foundry = "0.1"). Applications maintain their own independent Git repository with 0 upstream merge conflicts.

Self-Contained Subsystems

Subsystems encapsulate custom API controllers, business services, DTO validation, and Admin UI pages in clean, cohesive modules.

Dual-Tier Storage & Multi-DB SPI

Database-native strategy: genuine Zero-DDL dynamic models & Auto-CRUD for PostgreSQL/MongoDB; isolated subsystem DDL tables & deferred joins for MySQL/MariaDB.

Automatic RESTful CRUD

Instant, high-performance REST APIs generated for all dynamic models (GET, POST, PUT, DELETE) with fine-grained access control.

Hierarchical IAM & Topic RBAC

Super Admin (super_admin), Platform Admin (admin), and scoped Topic Admins with SMTP two-factor authentication and token security.

Layered Observability & Audit

Out-of-the-box structured tracing, HTTP TraceLayer latency telemetry, and non-blocking asynchronous mutation audit logging.

Static & Dynamic Dual-Tier Configs

Combines strongly typed environment configurations with real-time, schema-driven hot-reloaded subsystem dynamic settings.

Unified Release Packaging

Automated build pipeline (build-release.sh) merging the server binary, Admin SPA, and custom pages into a single production bundle.


🌐
Client Requests
Admin SPA / Mobile Apps / HTTP Clients
⚡
Axum Routing Engine
Context Extraction & Topic RBAC
⚙️
Subsystem Runtime
Auto-CRUD + Self-Contained Rust + Admin UI
💾
Dual-Tier Storage
Multi-DB SPI: Zero-DDL (PG/Mongo) + Subsystem DDL (MySQL/MariaDB) + Redis

Foundry adopts a Database-Native Strategy, avoiding “lowest common denominator SQL” while providing a unified, driver-agnostic method API (state.db.records()) with tailored physical storage implementations:

Database Engine Architecture Mode Physical Implementation Subsystem & Model Lifecycle Recommended Scenarios
PostgreSQL 14+ Native Zero-DDL JSONB binary storage + USING GIN(data) inverted indexes + partial indexes Genuine 0-DDL
Visual model creation in Admin UI; single-table multi-tenant isolation
Agile dynamic forms, rapid prototyping, medium-to-high concurrency
MongoDB 6.0+ Native 0-DDL Native BSON Documents + Wildcard ($**) dynamic indexing + atomic _counters Pure Schemaless
Zero schema migrations; collections auto-instantiate on write
Massive unstructured records, document-first workloads, high ingest rates
MySQL 8.0+ / 8.4+ Dedicated Subsystem DDL Subsystem-isolated physical tables + compact covering indexes + deferred joins Dialect DDL Migration
Scaffold generates DDL (migrations/mysql/*.sql); dev auto-sync & production DBA offline audit
High-volume transactional orders, rigid relational structures, enterprise DBA audits
MariaDB 10.5+ Dedicated Subsystem DDL Dedicated MariaDbProvider + dialect initialization + InnoDB compact indexes Dialect DDL Migration
Native mariadb:// protocol routing + subsystem isolated table DDL
Open-source enterprise clusters, high-concurrency transactional subsystems

[!NOTE] Universal Engine Baseline:

  • Driver-Agnostic Facade: Application logic accesses data via clean standard Trait methods (state.db.records(), state.db.systems()) with 0 driver object leakage.
  • Zero Physical DELETE Privilege Guarantee: Strict soft-deletion (deleted_at) across all modules ensures 100% full operational capability even if DBAs revoke physical DELETE permissions.