Backstage Application
The Backstage application is the core of the DevEx Platform, providing a unified developer portal with custom plugins for GCP, GitHub, Vault, and more.
Directory Structure
backstage/
├── packages/
│ ├── app/ # Frontend React application
│ │ └── src/
│ │ ├── App.tsx # Main app component
│ │ └── components/ # UI components
│ │
│ └── backend/ # Backend API server
│ └── src/
│ ├── index.ts # Entry point
│ └── plugins/ # Plugin integrations
│
├── plugins/ # 13 custom plugins
│ ├── homepage-links/ # Dashboard customization
│ ├── claude-flow/ # AI development
│ ├── vault-secrets/ # Secret management
│ ├── terraform-cloud/ # TFC integration
│ ├── mockup/ # UI mockups
│ └── *-backend/ # Backend counterparts
│
├── docs/ # Backstage-specific docs
├── tests/ # E2E and integration tests
└── CLAUDE.md # Development rules
Plugin Overview
Frontend Plugins
| Plugin | Package | Purpose | Docs |
|---|---|---|---|
| Homepage Links | @internal/plugin-homepage-links | Customizable dashboard | Details |
| Claude Flow | @internal/plugin-claude-flow | AI development integration | Details |
| Vault Secrets | @internal/backstage-plugin-vault-secrets | Secret management UI | Details |
| Terraform Cloud | @internal/plugin-terraform-cloud | TFC integration UI | Details |
| Mockup | @internal/plugin-mockup | UI mockup canvas | Details |
See Plugins Overview for detailed documentation.
Backend Plugins
| Plugin | Package | Purpose | Docs |
|---|---|---|---|
| Homepage Links Backend | @internal/plugin-homepage-links-backend | User preferences | Details |
| Homepage Repos Backend | @internal/plugin-homepage-repos-backend | GitHub repos | Details |
| Homepage GCP Projects Backend | @internal/plugin-homepage-gcp-projects-backend | GCP projects | Details |
| Claude Flow Backend | @internal/plugin-claude-flow-backend | AI sessions | Details |
| Vault Secrets Backend | @internal/backstage-plugin-vault-secrets-backend | Vault integration | Details |
| Terraform Cloud Backend | @internal/plugin-terraform-cloud-backend | TFC operations | Details |
| Terraform State Backend | @internal/plugin-terraform-state-backend | State management | Details |
| Mockup Backend | @internal/plugin-mockup-backend | Mockup persistence | Details |
Application Architecture
Authentication
The application supports multiple authentication providers:
| Provider | Use Case |
|---|---|
| GitHub OAuth | Developer login, PR operations |
| Google OAuth | GCP access, user identity |
| GCP IAP | Production access control |
| Guest | Development environment |
Dual Authentication Pattern
Important
User-initiated actions (PR reviews, comments) MUST use the user's OAuth token, not the backend service account.
Configuration
Base Configuration
# app-config.yaml
app:
title: DevEx Backstage
baseUrl: http://localhost:3001
backend:
baseUrl: http://localhost:7007
listen:
port: 7007
database:
client: pg
connection:
host: ${POSTGRES_HOST}
port: ${POSTGRES_PORT}
user: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
Local Development
# app-config.local.yaml
backend:
database:
connection:
host: localhost
port: 5432
user: postgres
password: postgres
cors:
origin: http://localhost:3001
allowedHeaders:
- X-Gcp-Access-Token
- X-GitHub-Token
Production
The app-config.production.yaml.tpl template is processed during deployment with environment variables from Terraform outputs.
Database
Connection
- Engine: PostgreSQL 15
- ORM: Knex.js
- Migrations: Per-plugin migrations in
migrations/directories
Pool Configuration
database:
pool:
min: 5
max: 20
Development
Prerequisites
- Node.js 20+ (22 recommended)
- Yarn 4.4.1
- PostgreSQL 15
- Docker (for Claude Flow)
Quick Start
cd backstage
yarn install
yarn dev
Useful Commands
| Command | Purpose |
|---|---|
yarn dev | Start frontend and backend |
yarn start | Start frontend only |
yarn start-backend | Start backend only |
yarn tsc | TypeScript compilation |
yarn lint | Run ESLint |
yarn test | Run all tests |
yarn build:backend | Production build |
Ports
| Service | Port |
|---|---|
| Frontend | 3001 |
| Backend | 7007 |
Testing
Unit Tests
yarn test
E2E Tests (Playwright)
cd tests
npx playwright test
Related Documentation
- Plugins - Detailed plugin documentation
- Architecture Overview
See Also
For Backstage-specific development rules, see /backstage/CLAUDE.md