Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevPlatform

Build Status Go Version Next.js License

AI-Native Developer Platform - A self-hosted developer platform with AI-assisted workflows for code review, documentation generation, test creation, and code migration. Built with GitOps principles for ephemeral preview environments.

🎯 Features

  • GitOps Preview Environments: Create ephemeral environments on every PR like Vercel/Netlify but self-hosted
  • AI-Assisted Workflows:
    • Automated PR code review with configurable focus areas
    • Documentation generation (README, API docs, architecture)
    • Test generation with target coverage goals
    • Code migration between languages (JSβ†’TS, Pythonβ†’Go, etc.)
  • Multi-Project Management: Organize projects, environments, and deployments
  • Real-time Updates: WebSocket-based live deployment logs and status
  • Full Observability: OpenTelemetry + Prometheus + Grafana + Tempo + Loki
  • Kubernetes Native: Deploy with kustomize, GitOps via ArgoCD

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend  │────▢│ Control     │────▢│  PostgreSQL β”‚
β”‚  (Next.js)  β”‚     β”‚  Plane      β”‚     β”‚  (Primary)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  (Go/Gin)   β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                β–Ό                β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   NATS    β”‚   β”‚   Redis   β”‚   β”‚  Workers  β”‚
    β”‚ (Queue)   β”‚   β”‚ (Cache/   β”‚   β”‚ (Async    β”‚
    β”‚           β”‚   β”‚  Logs)    β”‚   β”‚  Jobs)    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                β–Ό                β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Prometheusβ”‚   β”‚   Tempo   β”‚   β”‚   Loki    β”‚
    β”‚ (Metrics) β”‚   β”‚ (Traces)  β”‚   β”‚ (Logs)    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  Grafana  β”‚
                    β”‚(Dashboards)β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Go 1.22+ (for local development)
  • Node.js 20+ (for frontend development)
  • kubectl & kustomize (for Kubernetes deployment)

Local Development

# Clone and enter
git clone https://github.com/atlur/devplatform.git
cd devplatform

# Start all services (PostgreSQL, NATS, Redis, Control Plane, Worker, Frontend, Observability)
make dev

# Or manually with docker-compose
docker-compose up -d

# Access points:
# Frontend:     http://localhost:3000
# API:          http://localhost:8080
# Grafana:      http://localhost:3001 (admin/admin)
# Prometheus:   http://localhost:9090
# NATS Monitor: http://localhost:8222

Configuration

Copy .env.example to .env and configure:

# Server
SERVER_ADDR=:8080

# Database
DATABASE_URL=postgres://devplatform:devplatform@localhost:5432/devplatform?sslmode=disable

# Message Queue
NATS_URL=nats://localhost:4222

# Cache & Logs
REDIS_ADDR=localhost:6379

# Authentication
JWT_SECRET=your-secure-random-secret

# AI Provider (openai, anthropic, ollama, mock)
AI_PROVIDER=mock
AI_API_KEY=your-api-key

# Observability
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

πŸ“ Project Structure

devplatform/
β”œβ”€β”€ cmd/
β”‚   β”œβ”€β”€ control-plane/     # API server entry point
β”‚   └── worker/            # Async job worker entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ ai/                # AI client (OpenAI, Anthropic, Ollama)
β”‚   β”œβ”€β”€ auth/              # JWT authentication
β”‚   β”œβ”€β”€ gitops/            # GitOps manager (kustomize, ArgoCD)
β”‚   β”œβ”€β”€ platform/          # Core platform logic
β”‚   └── worker/            # Job processor
β”œβ”€β”€ pkg/
β”‚   β”œβ”€β”€ models/            # Domain models
β”‚   └── telemetry/         # OpenTelemetry + Prometheus
β”œβ”€β”€ frontend/              # Next.js 14 + React + TypeScript
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/           # App Router pages
β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom hooks
β”‚   β”‚   β”œβ”€β”€ services/      # API client
β”‚   β”‚   └── lib/           # Utilities
β”œβ”€β”€ deploy/
β”‚   β”œβ”€β”€ docker/            # Dockerfiles
β”‚   β”œβ”€β”€ k8s/               # Kubernetes manifests (kustomize)
β”‚   β”‚   β”œβ”€β”€ base/          # Base configuration
β”‚   β”‚   └── overlays/      # Environment overlays
β”‚   └── observability/     # Prometheus, Tempo, Loki, Grafana configs
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ adr/               # Architecture Decision Records
β”‚   β”œβ”€β”€ api/               # OpenAPI specifications
β”‚   └── runbooks/          # Operational runbooks
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/         # CI/CD pipelines
β”‚   └── dependabot.yml     # Dependency updates
β”œβ”€β”€ docker-compose.yml     # Local development stack
β”œβ”€β”€ Makefile               # Common commands
β”œβ”€β”€ go.mod / go.sum        # Go dependencies
└── README.md

πŸ›  Development

Common Commands

# Development
make dev              # Start all services
make dev-logs         # Follow logs
make dev-stop         # Stop services

# Building
make build            # Build all binaries
make build-docker     # Build Docker images

# Testing
make test             # Run all tests
make test-unit        # Unit tests only
make test-integration # Integration tests
make test-coverage    # Coverage report

# Code Quality
make lint             # All linters
make fmt              # Format all code
make vet              # Go vet

# Database
make migrate-up       # Run migrations
make migrate-create NAME=add_table  # Create migration

# Documentation
make adr-new TITLE="Use Redis"      # Create ADR
make docs-serve       # Serve docs locally

API Development

The control plane exposes a REST API with OpenAPI documentation:

# Health checks
curl http://localhost:8080/health
curl http://localhost:8080/ready

# Authentication
curl -X POST http://localhost:8080/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"password"}'

# Projects
curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/api/v1/projects
curl -X POST -H "Authorization: Bearer $TOKEN" http://localhost:8080/api/v1/projects \
  -d '{"name":"my-project","description":"My project"}'

Adding AI Providers

Implement the AIClient interface in internal/ai/client.go:

type AIClient interface {
    Chat(ctx context.Context, messages []Message) (string, error)
    ChatStream(ctx context.Context, messages []Message) (<-chan string, error)
    ReviewPR(ctx context.Context, req ReviewRequest) (*ReviewResult, error)
    GenerateDocs(ctx context.Context, req DocsRequest) (*DocsResult, error)
    GenerateTests(ctx context.Context, req TestsRequest) (*TestsResult, error)
    MigrateCode(ctx context.Context, req MigrateRequest) (*MigrateResult, error)
}

πŸ“¦ Deployment

Kubernetes (Production)

# Staging
kubectl apply -k deploy/k8s/overlays/staging

# Production
kubectl apply -k deploy/k8s/overlays/production

# Or with ArgoCD (recommended)
kubectl apply -f deploy/argocd/

Docker Compose (Simple)

# Production-like with docker-compose
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

πŸ” Security

  • Authentication: JWT HS256 with role-based access control
  • Authorization: Project-scoped permissions
  • Secrets: Kubernetes secrets / Docker secrets
  • Network: mTLS via service mesh (optional)
  • Scanning: Trivy, gosec, CodeQL in CI
  • SBOM: Syft-generated, cosign-signed
  • Dependency Updates: Dependabot weekly

See SECURITY.md for vulnerability reporting.

πŸ“Š Observability

The platform includes a complete observability stack:

  • Metrics: Prometheus + Grafana dashboards
  • Traces: Tempo (OpenTelemetry)
  • Logs: Loki + Grafana
  • Alerting: Alertmanager (configured separately)

Key dashboards:

  • DevPlatform Overview
  • Deployment Pipeline
  • AI Job Performance
  • System Health

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See CONTRIBUTING.md for guidelines.

πŸ“„ License

Licensed under the Apache License, Version 2.0. See LICENSE.

πŸ™ Acknowledgments

About

πŸ§ βš™οΈ Engineering the control plane for AI-native software delivery. πŸš€

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages