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.
⚡ Next-Gen Rust Backend Framework · Decoupled Subsystem Architecture
cargo install --git https://github.com/foundkit/foundry foundry_clifoundry new my-appcd my-app && cargo runFramework & 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.
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 physicalDELETEpermissions.