Devflow
Product:
products/devflow/
DevFlow is a comprehensive development workflow automation platform that streamlines code development, testing, deployment, and monitoring.
DevFlow is a comprehensive development workflow automation platform that streamlines code development, testing, deployment, and monitoring.
Architecture
DevFlow follows a microservices architecture with 7 independent services:
1. devflow-api (Port 3100)
Public API gateway for DevFlow product
- Authentication and authorization
- Rate limiting
- Request routing to microservices
- RESTful API endpoints
Endpoints:
/api/v1/projects/*- Project management/api/v1/deployments/*- Deployment operations/api/v1/tests/*- Test execution
2. devflow-devb (Port 3101)
DEVB System - Design-Emulate-Validate-Build
- Design specification generation
- Design emulation (dry-run, static-analysis, simulation)
- Multi-perspective validation (Security, Performance, Cost, UX)
- Complete specification generation
Key Services:
spec-generator.ts- 1,980 lines of specification logicvalidation-engine.ts- 1,382 lines of validation logic
3. devflow-cicd (Port 3102)
CI/CD Pipeline Execution
- GitHub Actions integration
- GitLab CI integration
- Pipeline stage management
- Deployment orchestration
External Integrations:
- GitHub API
- GitLab API
- Docker registries
4. devflow-testing (Port 3103)
Test Execution & Coverage
- Unit test execution
- Integration test execution
- E2E test execution
- Coverage tracking and reporting
5. devflow-monitoring (Port 3104)
Application Monitoring
- Prometheus metrics queries
- Grafana dashboard integration
- Loki log aggregation
- Alert rule management
6. devflow-worker (Background)
Async Job Processing
- Redis-backed job queue
- Code analysis tasks
- Test execution
- Deployment tasks
- 3 concurrent workers
7. devflow-frontend (Port 3105)
React SPA UI
- Project dashboard
- Deployment history
- Test results visualization
- Real-time monitoring
Database Schema
DevFlow uses the devflow_db database with ~52 tables organized into:
- Projects (~15 tables) - projects, repositories, branches, commits
- DEVB System (~20 tables) - designs, emulations, validations
- CI/CD (~12 tables) - pipelines, stages, deployments, environments
- Monitoring (~5 tables) - metric definitions, alert rules, incidents
Quick Start
Prerequisites
- Shared infrastructure running (PostgreSQL, Redis, etc.)
- Docker and Docker Compose installed
- Environment variables configured
Setup
# 1. Copy environment templatecp .env.devflow.template .env.devflow
# 2. Update environment variablesnano .env.devflow
# 3. Start all DevFlow servicesdocker-compose up -d
# 4. Verify health./scripts/verify-devflow.shAccess URLs
| Service | URL | Purpose |
|---|---|---|
| API | http://localhost:3100 | REST API gateway |
| DEVB | http://localhost:3101 | Design system |
| CI/CD | http://localhost:3102 | Pipeline management |
| Testing | http://localhost:3103 | Test execution |
| Monitoring | http://localhost:3104 | Metrics & logs |
| Frontend | http://localhost:3105 | Web UI |
Commands
DevFlow includes 43 type-safe commands organized by category:
dev (Development)
implement- Implement a new feature with TDDtest- Run tests with coveragereview- Code review automationrefactor- Intelligent refactoringdebug- Debug production issues
devops (DevOps)
deploy- Deploy to environmentrollback- Emergency rollbackmonitor- Monitor deploymentscale- Scale servicescost-analyze- Analyze cloud costs
design (Design System)
solution- Create design specificationemulate- Emulate design (dry-run)validate- Validate designspec- Generate complete specs
db (Database)
migrate- Run migrationsbackup- Backup databaserestore- Restore from backupquery- Execute queries
docker (Containers)
build- Build container imagespush- Push to registryscan- Security scanoptimize- Optimize image size
Development
Project Structure
products/devflow/├── services/│ ├── api/ # API gateway service│ ├── devb/ # DEVB system service│ ├── cicd/ # CI/CD service│ ├── testing/ # Testing service│ ├── monitoring/ # Monitoring service│ ├── worker/ # Background worker│ └── frontend/ # React frontend├── commands/│ ├── dev/ # Development commands│ ├── devops/ # DevOps commands│ ├── design/ # Design commands│ ├── db/ # Database commands│ └── docker/ # Docker commands├── database/│ └── migrations/ # SQL migration files├── docker-compose.yml└── README.mdAdding a New Command
import { CommandBase, CommandContext, CommandResult } from '@mahoosuc/command-framework'import { z } from 'zod'
const schema = z.object({ // Define arguments})
export class NewCommand extends CommandBase<typeof schema> { name = 'new-command' category = 'dev' description = 'Description of the command' schema = schema
async execute(args, ctx) { // Implementation return { success: true, message: 'Done' } }}Adding a New Service
- Create service directory:
services/new-service/ - Add Dockerfile and package.json
- Implement service logic in
src/ - Add to docker-compose.yml
- Update documentation
Testing
# Run all testsnpm run test
# Run service-specific testsnpm run test:apinpm run test:devbnpm run test:cicd
# E2E testsnpm run test:e2e
# Coverage reportnpm run test:coverageDeployment
Staging
docker-compose -f docker-compose.staging.yml up -dProduction
# Build production imagesdocker-compose build --no-cache
# Push to registrydocker-compose push
# Deploy with rolling updatedocker-compose -f docker-compose.prod.yml up -d --remove-orphansMonitoring
Prometheus Metrics
All services expose metrics at /metrics:
devflow_api_requests_total- Total API requestsdevflow_api_request_duration_seconds- Request latencydevflow_pipeline_executions_total- Pipeline executionsdevflow_test_runs_total- Test runsdevflow_deployments_total- Deployments
Grafana Dashboards
Pre-configured dashboards:
- DevFlow Overview
- API Performance
- Pipeline Success Rate
- Test Coverage Trends
- Deployment Frequency
Logs
All services log to stdout/stderr, collected by Promtail and sent to Loki:
# Query logs via Lokicurl -G http://localhost:3101/loki/api/v1/query \ --data-urlencode 'query={product="devflow"}'Troubleshooting
Services won’t start
# Check logsdocker-compose logs -f
# Restart specific servicedocker-compose restart devflow-api
# Full restartdocker-compose down && docker-compose up -dDatabase connection issues
# Test database connectiondocker exec shared-postgres pg_isready -U postgres
# Check devflow_db existsdocker exec shared-postgres psql -U postgres -l | grep devflowAPI returning 500 errors
# Check API logsdocker-compose logs devflow-api
# Check database migrationsnpm run db:status
# Run pending migrationsnpm run db:migrateMigration from Monolith
DevFlow was extracted from a monolithic architecture using the Strangler Fig pattern:
- Week 1-2: Service extraction and directory setup
- Week 3-4: Database migration (52 tables) with dual-write
- Week 5-6: Containerization and local testing
- Week 7-8: Command migration (43 commands)
- Week 9-10: Production deployment with gradual cutover
Related Documentation
Support
For issues or questions:
- GitHub Issues: https://github.com/mahoosuc/devflow/issues
- Slack: #devflow-support
- Email: devflow-support@mahoosuc.com
License
MIT © Mahoosuc Solutions