Thanks for your interest in contributing! This guide will help you get started.
- Check existing issues first
- Use the bug report template
- Include reproduction steps and environment details
- Check existing issues first
- Use the feature request template
- Explain the use case and why it would be useful
git clone https://github.com/icancodefyi/basecompose.git
cd basecomposegit checkout -b feature/your-feature-name
# or
git checkout -b fix/your-fix-namepnpm install
# Or run the setup script:
./scripts/setup.sh # macOS/Linux
./scripts/setup.bat # Windows- Write clean, well-commented code
- Follow the existing code style
- Add tests if applicable
- Update documentation if needed
pnpm lint
pnpm lint:fixgit add .
git commit -m "feat: add your feature description"
# or
git commit -m "fix: describe what you fixed"Use conventional commits:
feat:for new featuresfix:for bug fixesdocs:for documentationrefactor:for code refactoringtest:for adding testschore:for maintenance
git push origin your-branch-nameGo to GitHub and create a Pull Request. Fill out the PR template.
basecompose/
├── app/ # Next.js application
├── packages/ # pnpm workspaces
├── templates/ # Template files
├── lib/ # Utility functions
├── components/ # Shared components
└── public/ # Static assets
- Stack Configuration:
packages/types/stack-config.ts- Add new tech options here - Type Definitions:
packages/types/blueprint.ts- Update types when adding options - Generation Engine:
packages/engine/- Handles stack generation - Chat Page:
app/chat/- Main chat interface
All stack configurations are centralized in packages/types/stack-config.ts.
Find the appropriate category (frontend, backend, database, auth) and add your option:
backend: {
label: "Backend",
description: "Choose your backend runtime",
options: {
// Existing options...
go: {
label: "Go",
description: "Go HTTP server",
dockerImage: "golang:1.21-alpine",
port: 8080,
},
},
}If your technology has dependencies, add a resolution rule:
export const RESOLUTION_RULES = [
// Existing rules...
{
name: "Go requires PostgreSQL",
condition: (stack: any) => stack.backend === "go" && !stack.database,
apply: (stack: any) => {
stack.database = "postgres";
},
},
];Update packages/types/blueprint.ts to include your new option:
export type StackBlueprint = {
intent: "saas" | "api";
frontend?: "nextjs";
backend?: "node" | "fastapi" | "go"; // Add "go" here
database?: "postgres";
auth?: "authjs";
};-
Type check:
pnpm exec tsc --noEmit -
Test in UI:
- Start dev server:
pnpm dev - Chat with AI: "I need a Go backend"
- Verify stack updates in sidebar
- Click "Download Stack" and check generated files
- Start dev server:
-
Verify generated files:
- Open the downloaded zip
- Check
docker-compose.ymlhas your service - Verify ports and environment variables
To add a completely new category (e.g., "monitoring"):
export const STACK_CONFIG = {
// Existing categories...
monitoring: {
label: "Monitoring",
description: "Choose your monitoring solution",
options: {
prometheus: {
label: "Prometheus",
description: "Metrics and alerting",
dockerImage: "prom/prometheus:latest",
port: 9090,
},
},
},
} as const;export type StackBlueprint = {
intent: "saas" | "api";
frontend?: "nextjs";
backend?: "node" | "fastapi";
database?: "postgres";
auth?: "authjs";
monitoring?: "prometheus"; // Add new category
};Edit packages/engine/emit/docker.ts:
// Add after other services
if (stack.monitoring) {
const monitoringConfig = getOptionConfig("monitoring", stack.monitoring);
services[stack.monitoring] = {
image: monitoringConfig.dockerImage,
ports: [`${monitoringConfig.port}:${monitoringConfig.port}`],
// ... add volumes, configs, etc.
};
}Edit packages/engine/emit/env.ts:
if (stack.monitoring === "prometheus") {
lines.push("\n# Monitoring (Prometheus)");
lines.push("PROMETHEUS_RETENTION=15d");
}Edit packages/engine/emit/readme.ts:
if (stack.monitoring) lines.push(`- Monitoring: ${stack.monitoring}`);Each option should have:
label: User-facing namedescription: Short explanationdockerImage: Docker image to useport: Default port numberenvVars: (Optional) Environment variables objectrequiresDatabase: (Optional) Boolean flag
- Keep rules simple and focused
- Use descriptive names
- Test interactions between rules
- Document why the rule exists
Before submitting a PR:
- ✅ Type checking passes
- ✅ AI can understand your new option
- ✅ Generated docker-compose.yml is valid
- ✅ All existing tests pass
- ✅ New option appears in UI
Here's a complete example of adding Redis support:
database: {
options: {
postgres: { /* existing */ },
redis: {
label: "Redis",
description: "In-memory cache",
dockerImage: "redis:7-alpine",
port: 6379,
},
},
}database?: "postgres" | "redis";The existing code already handles this dynamically! No changes needed.
if (stack.database === "redis") {
lines.push("\n# Database (Redis)");
lines.push("REDIS_URL=redis://localhost:6379");
}pnpm dev
# Chat: "add redis cache"
# Verify in sidebar
# Download and check files- Check existing code in
packages/types/stack-config.ts - Look at how existing options are implemented
- Open an issue for discussion
- Use TypeScript strict mode
- Follow existing naming conventions
- Add JSDoc comments for new functions
- Keep configuration declarative