-
packages/engine/generate.ts- Main orchestration (7-step pipeline) -
packages/engine/copy.ts- File operations (framework + addons) -
packages/engine/emit/docker.ts- Docker Compose generation (dev/prod) -
packages/engine/emit/env.ts- Environment variable collection -
packages/engine/types.ts- Type definitions for generation state
-
packages/types/blueprint.ts- StackBlueprint with database & auth options -
packages/types/stack-config.ts- Stack configuration with MongoDB/Auth.js - Global type declarations (
global.d.ts) - js-yaml and tar module types
-
app/api/generate/route.ts- HTTP endpoint for project generation -
app/page.tsx- Stack builder UI with local resolveStack() - Type safety fixes for client/server code separation
-
templates/frameworks/nextjs/base/- Next.js scaffold with package.json -
templates/frameworks/nextjs/docker/- Dockerfile & .dockerignore
-
templates/databases/mongodb/- client.ts (connection helper)
- env.ts (MONGODB_URI, username, password)
- docker/docker-compose.mongo.yml (service fragment)
- README.md (documentation)
-
templates/auth/authjs/- config.ts (NextAuth configuration with GitHub OAuth)
- routes/[...nextauth].ts (route handler)
- env.ts (GitHub OAuth & NextAuth variables)
- README.md (OAuth setup instructions)
-
templates/demo/- api/health.ts (feature availability check)
- ui/page.tsx (DemoHero component for homepage)
- README.md (integration documentation)
-
templates/shared/docker-compose.dev.yml- pnpm dev command
- Volume mounts for hot reload
- No authentication
- Proper service dependencies
-
templates/shared/docker-compose.prod.yml- NODE_ENV=production
- restart: always
- MongoDB authentication
- Volume persistence
-
templates/shared/README_SETUP.md- Comprehensive setup guide
-
Framework Copying
- Copy Next.js base scaffold
- Copy Dockerfile & .dockerignore
- Preserve package.json with dependencies
-
Addon Integration
- MongoDB client.ts placed in app/lib/db/
- Auth.js routes in app/api/auth/[...nextauth]
- Demo component integrated into homepage
- All addon files in correct locations
-
Docker Compose
- Separate development compose file
- Separate production compose file
- Service merging from addon fragments
- Correct environment variables
- Volume management for MongoDB
-
Environment Variables
- Parse addon env.ts files
- Generate .env.example file
- Document all required variables
- Support optional variables
-
Project Output
- Create .gitignore
- Copy SETUP.md guide
- Archive as tar.gz
- Return as downloadable buffer
- No errors in main app files
- No errors in generation engine
- Type declarations for external modules
- Proper TypeScript configuration
- Development mode with hot reload
- Production mode with security hardening
- Proper error handling throughout
- Comprehensive documentation
Core Engine (4 files, 0 errors)
✓ packages/engine/generate.ts (135 lines)
✓ packages/engine/copy.ts (100+ lines)
✓ packages/engine/emit/docker.ts (202 lines)
✓ packages/engine/emit/env.ts (80+ lines)
Types (3 files, 0 errors)
✓ packages/types/blueprint.ts
✓ packages/types/stack-config.ts
✓ global.d.ts (module declarations)
API & UI (2 files, 0 errors)
✓ app/api/generate/route.ts (28 lines)
✓ app/page.tsx (373 lines, fixed type annotation)
Templates (5 directories, expected import errors during generation)
✓ templates/frameworks/nextjs/base/ (scaffold)
✓ templates/frameworks/nextjs/docker/ (container config)
✓ templates/databases/mongodb/ (addon)
✓ templates/auth/authjs/ (addon)
✓ templates/demo/ (addon)
✓ templates/shared/ (docker-compose files + setup guide)
pnpm dev
# http://localhost:3000- Select stack components (Next.js, MongoDB, Auth.js)
- Click "Generate & Download"
- Extract tar.gz file
cd extracted-project
# Development with hot reload
pnpm install && pnpm dev
# OR
docker compose -f docker-compose.dev.yml up
# Production
docker compose -f docker-compose.prod.yml up --buildThese errors only appear in template files and are resolved when the project is generated:
Cannot find module '@/app/lib/components/demo-hero'(resolved when copied)Cannot find module '@/app/lib/db/mongodb'(resolved when copied)Cannot find module 'mongodb'(installed in generated project)Cannot find module 'next-auth'(installed in generated project)
Overall Status: ✅ PRODUCTION READY
The BaseCompose template-based project generator is fully implemented and ready for use. Users can:
- Select stack components via the UI
- Generate production-ready projects
- Download tar.gz archives
- Run locally or in Docker
- Use comprehensive setup documentation
All critical files are in place, type-safe, and properly integrated.