| title | description | category | tags | updated-date | difficulty-level | |||
|---|---|---|---|---|---|---|---|---|
Development Setup Guide |
This guide will help you set up a complete development environment for VisionFlow. Follow these steps to start contributing to the project. |
how-to |
|
2025-12-18 |
beginner |
This guide will help you set up a complete development environment for VisionFlow. Follow these steps to start contributing to the project.
| Tool | Minimum Version | Purpose |
|---|---|---|
| Git | 2.30+ | Version control |
| Node.js | 16.x LTS or 18.x LTS | JavaScript runtime |
| npm | 8.x+ | Package management |
| Docker | 20.10+ | Container runtime |
| Docker Compose | 1.29+ | Multi-container orchestration |
| Tool | Purpose |
|---|---|
| Python | 3.9+ (if using Python components) |
| Go | 1.19+ (if working on Go services) |
| PostgreSQL | 14+ (for local database) |
| Redis | 6+ (for caching) |
| Make | Build automation |
Recommended IDE/Editor:
- VS Code with extensions:
- ESLint
- Prettier
- Docker
- GitLens
- REST Client
SPARC workflow:
# Full TDD workflow
npx claude-flow sparc tdd "feature description"
# Individual phases
npx claude-flow sparc run spec-pseudocode "task"
npx claude-flow sparc run architect "task"
npx claude-flow sparc run integration "task"Parallel agent execution (Claude Code Task tool):
// Spawn multiple agents concurrently
Task("Researcher", "Analyze requirements", "researcher")
Task("Architect", "Design system", "system-architect")
Task("Coder", "Implement features", "coder")
Task("Tester", "Create tests", "tester")- IntelliJ IDEA or WebStorm
- Vim/Neovim with appropriate plugins
# Fork the repository on GitHub first, then:
# Clone your fork
git clone https://github.com/YOUR-USERNAME/visionflow.git
cd visionflow
# Add upstream remote
git remote add upstream https://github.com/original-org/visionflow.git
# Verify remotes
git remote -v# Install Node.js dependencies
npm install
# Or use yarn
yarn install
# Install Python dependencies (if applicable)
pip install -r requirements-dev.txt
# Install Go dependencies (if applicable)
go mod download# Copy example environment file
cp .env.example .env
# Edit .env with your local settings
nano .envExample .env configuration:
# Application
NODE-ENV=development
PORT=8080
API-PORT=9090
# Database
DB-HOST=localhost
DB-PORT=5432
DB-NAME=visionflow-dev
DB-USER=visionflow
DB-PASSWORD=dev-password
# Redis
REDIS-HOST=localhost
REDIS-PORT=6379
# Storage
STORAGE-TYPE=local
STORAGE-PATH=/tmp/visionflow-storage
# Logging
LOG-LEVEL=debug
LOG-FORMAT=pretty
# Development
HOT-RELOAD=true
DEBUG=true# Start all services
docker-compose -f docker-compose.dev.yml up -d
# View logs
docker-compose -f docker-compose.dev.yml logs -f
# Stop services
docker-compose -f docker-compose.dev.yml downdocker-compose.dev.yml includes:
- PostgreSQL database
- Redis cache
- MinIO (S3-compatible storage)
- MailHog (email testing)
- Mock services
# Start PostgreSQL
sudo systemctl start postgresql
# Start Redis
sudo systemctl start redis
# Or use Docker for individual services
docker run -d --name visionflow-postgres \
-e POSTGRES-DB=visionflow-dev \
-e POSTGRES-USER=visionflow \
-e POSTGRES-PASSWORD=dev-password \
-p 5432:5432 \
postgres:14
docker run -d --name visionflow-redis \
-p 6379:6379 \
redis:6-alpine# Create database
createdb visionflow-dev
# Run migrations
npm run db:migrate
# Seed development data
npm run db:seed
# Reset database (careful!)
npm run db:reset# Build all packages
npm run build
# Build specific package
npm run build:api
npm run build:web
npm run build:cli
# Watch mode (auto-rebuild on changes)
npm run build:watchdist/
├── api/ # API server build
├── web/ # Web UI build
├── cli/ # CLI tool build
└── shared/ # Shared libraries
# Start all services in development mode
npm run dev
# Start specific service
npm run dev:api # API server only
npm run dev:web # Web UI only
npm run dev:worker # Background worker onlyDevelopment features:
- Hot module replacement (HMR)
- Auto-restart on file changes
- Source maps enabled
- Verbose logging
- Debug mode enabled
| Service | URL | Purpose |
|---|---|---|
| Web UI | http://localhost:3030 | Main interface |
| API | http://localhost:9090 | REST API |
| API Docs | http://localhost:9090/docs | Swagger UI |
| GraphQL | http://localhost:9090/graphql | GraphQL playground |
| MailHog | http://localhost:8025 | Email testing |
# Create test database
createdb visionflow-test
# Configure test environment
cp .env.test.example .env.test
# Run migrations for test database
NODE-ENV=test npm run db:migrate# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test suite
npm test -- --grep "API"
# Watch mode
npm run test:watch
# E2E tests
npm run test:e2e
# Integration tests
npm run test:integrationtests/
├── unit/ # Unit tests
├── integration/ # Integration tests
├── e2e/ # End-to-end tests
├── fixtures/ # Test data
└── helpers/ # Test utilities
# Run ESLint
npm run lint
# Auto-fix issues
npm run lint:fix
# Lint specific files
npm run lint -- src/api/**/*.jsESLint Configuration (.eslintrc.js):
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
rules: {
'no-console': 'warn',
'no-unused-vars': 'error'
}
};# Format all files
npm run format
# Check formatting
npm run format:check
# Format specific files
prettier --write "src/**/*.{js,ts,json,md}"Prettier Configuration (.prettierrc):
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}# Run TypeScript compiler
npm run typecheck
# Watch mode
npm run typecheck:watchWe use Husky for Git hooks:
# Install husky
npm run prepare
# Hooks automatically run on:
# - pre-commit: lint, format, typecheck
# - pre-push: testflowchart TD
A[Create Branch] --> B[Write Code]
B --> C[Run Tests Locally]
C --> D{Tests Pass?}
D -->|No| B
D -->|Yes| E[Commit Changes]
E --> F[Push to Fork]
F --> G[Create PR]
G --> H[CI/CD Pipeline]
H --> I{CI Pass?}
I -->|No| B
I -->|Yes| J[Code Review]
J --> K{Approved?}
K -->|No| B
K -->|Yes| L[Merge to Main]
style D fill:#FFE4B5
style I fill:#FFE4B5
style L fill:#90EE90
# Feature branches
git checkout -b feature/add-user-authentication
# Bug fixes
git checkout -b fix/resolve-upload-timeout
# Hotfixes
git checkout -b hotfix/security-patch
# Documentation
git checkout -b docs/update-api-guideFollow Conventional Commits:
# Format
<type>(<scope>): <description>
# Examples
feat(api): add user authentication endpoint
fix(web): resolve file upload timeout issue
docs(readme): update installation instructions
refactor(storage): improve S3 integration
test(api): add integration tests for auth
chore(deps): upgrade dependenciesTypes:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug API Server",
"program": "${workspaceFolder}/src/api/index.js",
"env": {
"NODE-ENV": "development",
"DEBUG": "visionflow:*"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceFolder}/node-modules/jest/bin/jest",
"args": ["--runInBand", "--no-cache"],
"console": "integratedTerminal"
}
]
}// Enable debug logs
DEBUG=visionflow:* npm run dev
// Specific modules
DEBUG=visionflow:api,visionflow:db npm run dev# Start with Node inspector
node --inspect src/api/index.js
# Or with npm script
npm run dev:debugThen open: chrome://inspect
- Define route in
src/api/routes/ - Create controller in
src/api/controllers/ - Add service logic in
src/api/services/ - Write tests in
tests/unit/api/ - Update API documentation
- Create feature branch
- Implement feature with TDD approach
- Add/update documentation
- Run full test suite
- Submit pull request
# Check for outdated packages
npm outdated
# Update package
npm update package-name
# Update all packages (careful!)
npm update
# Check for security vulnerabilities
npm audit
# Fix vulnerabilities
npm audit fix# CPU profiling
node --prof src/api/index.js
# Memory profiling
node --inspect --expose-gc src/api/index.js# Start with metrics enabled
ENABLE-METRICS=true npm run dev
# Access metrics
curl http://localhost:9090/metrics# Development
npm run dev
# Staging
NODE-ENV=staging npm start
# Production
NODE-ENV=production npm start.env.example # Template
.env # Local development (gitignored)
.env.test # Test environment
.env.staging # Staging environment
.env.production # Production environment
# Find process using port
lsof -i :8080
# Kill process
kill -9 <PID># Check PostgreSQL status
pg-isready -h localhost -p 5432
# Reset database
npm run db:reset# Clear cache and reinstall
rm -rf node-modules package-lock.json
npm cache clean --force
npm install# Clean build artifacts
npm run clean
# Rebuild
npm run build- Review Project Structure
- Understand Architecture
- Learn about Adding Features
- Set up Testing
- Read Contributing Guidelines
- API Documentation: http://localhost:9090/docs
- Storybook (UI components): http://localhost:6006
- GraphQL Playground: http://localhost:9090/graphql
- Internal Wiki: [Link to wiki]
- Pipeline Operator Runbook
- Project Structure
- Multi-Agent Docker Environment Architecture
- Multi-Agent Docker Environment - Complete Documentation
- Contributing Guidelines
- Slack/Discord: #visionflow-dev
- Team Meetings: Weekly on [day/time]
- Pair Programming: Schedule via [calendar link]
- Documentation: https://docs.visionflow.dev
Navigation: | 💻 Developer Guide | 🏗️ Architecture | 🧪 Testing