Forge treats every backend system as a graph of typed components organized across four mandatory architectural domains. Rather than layering code by technical concern alone, Forge enforces ownership at the domain boundary: each module knows exactly where it lives, what it may import, and what may import it. The result is a system that can be audited, scored, and evolved without guesswork — because the architecture graph, not a wiki page, is the source of truth.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ronaldjdev/forge/llms.txt
Use this file to discover all available pages before exploring further.
The Four Domains
Every backend modeled by Forge is split into exactly these four domains. No directory outside this structure is recognized as an architectural owner.| Domain | Directory | Purpose | Examples |
|---|---|---|---|
| Platform | src/platform/ | Technical backbone shared globally across the entire system | config, server, logger, cache, DI, security, events, scheduler, observability |
| Features | src/features/<name>/ | Self-contained business capabilities organized as vertical slices | domain, application, adapters (auth, users, payments) |
| Shared | src/shared/ | Reusable pure code with zero infrastructure dependencies | errors, contracts, types, utils |
| Infrastructure | src/infra/ | Concrete implementations of ports defined by the domain | prisma, mongodb, redis, mail |
Project Directory Structure
The canonical layout Forge bootstraps and validates looks like this:Architecture Graph
The architecture graph is Forge’s source of truth. Every file is a node; every import is an edge. Forge builds this graph during boot and uses it to apply all dependency rules, calculate ownership, and derive system health metrics. Six node types are tracked:| Node Type | What it Represents |
|---|---|
platform | Files inside src/platform/ |
feature | Feature directories under src/features/ |
domain | Domain artifacts inside a feature’s domain/ |
adapter | Adapter files inside a feature’s adapters/ |
shared | Files inside src/shared/ |
infra | Files inside src/infra/ |
- Risk Score — a weighted measure of critical and high-severity violations
- Dependency Health — the ratio of valid edges to total edges in the graph
Graph category of forge inspect (20 points) and are written to ARCHITECTURE.md after every audit.
Boot Sequence
Every Forge operation begins with an identical 9-step sequence before any command logic runs. This guarantees that no action is taken on stale or incomplete context.context
Detect the current stack, discover all platform, feature, shared, and infra directories, read
package.json and tsconfig.json.armorer
Run ownership analysis — identify orphaned files, duplicate components, and misplaced artifacts.
profile
Match the detected stack against one of the 10 pre-built technology profiles, or synthesize a generic profile.
graph
Build the architecture graph: parse all imports, classify nodes by type, validate edges against R1–R13, compute risk score and dependency health.
chain
Build the multi-layer dependency graph, compute topological order, and detect any global dependency cycles.
inspect
Run the full architectural audit across all 10 scoring categories (180 points, normalized to 0–100).
The boot sequence uses a cache stored in
.forge/cache/. If source files under src/ have not changed since the last run, boot data is reused automatically. Pass --force to any command to regenerate the cache.Technology Profiles
Forge ships with 10 pre-built technology profiles. During boot, theprofile step matches your package.json dependencies to the correct profile, which then governs DI strategy, controller patterns, persistence setup, and naming conventions.
| Profile | Framework | Database | ORM | DI Strategy |
|---|---|---|---|---|
express-mongodb | Express | MongoDB | Mongoose | tsyringe |
express-postgres | Express | PostgreSQL | raw pg | Manual |
express-prisma | Express | PostgreSQL | Prisma | tsyringe |
express-drizzle | Express | PostgreSQL | Drizzle | tsyringe |
fastify-mongodb | Fastify | MongoDB | Mongoose | Manual |
fastify-postgres | Fastify | PostgreSQL | Prisma | Manual |
fastify-prisma | Fastify | PostgreSQL | Prisma | Manual |
nestjs-mongodb | NestJS | MongoDB | Mongoose | NestJS DI |
nestjs-postgres | NestJS | PostgreSQL | Prisma | NestJS DI |
nestjs-prisma | NestJS | PostgreSQL | Prisma | NestJS DI |
Explore Further
Layer Responsibilities
What belongs in Platform, Features, Shared, and Infra — and what is strictly forbidden in each.
Dependency Rules
All 13 enforced rules (R1–R13) with severity levels and violation examples.
Naming Conventions
File, class, interface, and artifact naming patterns that power Forge’s ownership detection.
inspect command
Run a full architectural audit: 10 categories, 180 points, score 0–100.