Monorepo-Only Architecture
V2 only supports monorepo projects. Single-app projects are no longer supported.
Why Monorepo-Only?
1. Workspace Dependencies
Monorepos enable workspace:* protocol for internal dependencies:
{
"dependencies": {
"@myproject/ui": "workspace:*",
"@myproject/auth": "workspace:*"
}
}Benefits:
- No version conflicts
- Always use latest internal code
- Faster development (no publishing needed)
2. Shared Code
Packages can be shared across apps:
my-project/
βββ apps/
β βββ web/ # Uses packages/ui, packages/auth
β βββ mobile/ # Uses packages/ui, packages/auth
βββ packages/
βββ ui/ # Shared UI components
βββ auth/ # Shared auth logicBenefits:
- Write once, use everywhere
- Consistent behavior across apps
- Single source of truth
3. Consistent Structure
All V2 projects have the same structure:
project/
βββ apps/
β βββ web/
β βββ mobile/
β βββ api/
βββ packages/
β βββ database/
β βββ auth/
β βββ ui/
βββ package.json # Workspaces configurationBenefits:
- Predictable structure
- Easier onboarding
- Tooling compatibility
4. Better Dependency Management
Monorepos provide:
- Centralized dependency management
- Workspace protocol for internal deps
- Consistent versions across packages
Limitations
No Single-App Projects
V2 cannot create single-app projects. If you need a simple single-app project:
Option 1: Use V1 (legacy support)
# V1 still supports single-app
architech new genome-v1.tsOption 2: Create minimal monorepo
// Minimal monorepo (one app, no packages)
apps: {
web: {
type: 'web',
framework: 'nextjs',
packages: [] // No packages
}
}Migration Required
Existing single-app projects must migrate to monorepo:
Before (V1):
my-app/
βββ src/
βββ package.json
βββ ...After (V2):
my-app/
βββ apps/
β βββ web/ # Your app
β βββ src/
β βββ package.json
βββ packages/ # Empty (no packages)
βββ package.json # Root with workspacesMigration Path
Step 1: Restructure
Move your app to apps/web/:
mkdir -p apps/web
mv src apps/web/
mv package.json apps/web/Step 2: Create Root package.json
{
"name": "my-project",
"private": true,
"workspaces": [
"apps/*",
"packages/*"
]
}Step 3: Update V2Genome
apps: {
web: {
type: 'web',
framework: 'nextjs',
packages: []
}
}Benefits Summary
| Feature | Single-App | Monorepo |
|---|---|---|
| Workspace Dependencies | β | β |
| Shared Code | β | β |
| Consistent Structure | β | β |
| Tooling Support | Limited | Full |
| Scalability | Limited | Excellent |
When to Use V2
Use V2 if:
- β You want workspace dependencies
- β You have multiple apps
- β You want shared packages
- β You want consistent structure
Use V1 if:
- β οΈ You need a simple single-app project
- β οΈ You don't want monorepo complexity
Note: V1 is still supported but V2 is recommended for new projects.
Related
- V2Genome Structure - How V2Genome defines structure
- Migration Guide - Step-by-step migration from V1
- Getting Started - Create your first V2 project