How oseghalep/cloud-cost-optimization-hub works
CCOH is a multi-cloud cost observability and optimization web application. Users register or log in, add cloud accounts, and view cost dashboards and optimization recommendations. The backend exposes authenticated API routes; account handlers trigger cost ingestion, while recommendation generation and dashboard queries are separate product stages. The README documents AWS, GCP, and Azure support, authentication, dashboard, and demo cost data. Some frontend-to-API wiring and unsampled handler behavior are not shown, so those links are omitted.
Main entry points: router.go API routing · postgres PostgreSQL repositories · multi_cloud_handlers.go GCP and Azure accounts · gcp_service.go GCP cost ingestion
Components 22
Web interface
- Login and register
frontend/app/login/page.tsx - Cloud accounts
frontend/app/accounts/page.tsx - Cost dashboard
frontend/app/dashboard/page.tsx - Recommendations view
frontend/app/recommendations/page.tsx - API client
frontend/lib/api.ts
API and identity
- HTTP server
backend/cmd/api/main.go - API routing
backend/internal/api/router.go - Authentication
backend/internal/api/handlers/auth.go - Account management
backend/internal/api/handlers/accounts.go - GCP and Azure accounts
backend/internal/api/handlers/multi_cloud_handlers.go - Dashboard queries
backend/internal/api/handlers/dashboard.go - Recommendation actions
backend/internal/api/handlers/recommendations.go
Cloud cost services
- AWS cost ingestion
backend/internal/services/cost_ingestion/aws_service.go - GCP cost ingestion
backend/internal/services/cost_ingestion/gcp_service.go - Azure cost ingestion
backend/internal/services/cost_ingestion/azure_service.go - Recommendation engine
backend/internal/services/recommendations/engine.go
Persistence and models
- PostgreSQL repositories
backend/internal/repository/postgres - PostgreSQL database
backend/pkg/db/db.go - Cost and account models
backend/internal/models
Other components
- Cloud cost user
- AWS Cost Explorer
- GCP and Azure
Connections 24
- Cloud cost user → Login and register: registers or logs in
- Cloud cost user → Cloud accounts: manages accounts
- Cloud cost user → Cost dashboard: views costs
- Cloud cost user → Recommendations view: reviews savings
- HTTP server → API routing: serves routes
backend/cmd/api/main.go - API routing → Authentication: routes auth
backend/internal/api/router.go - API routing → Account management: routes accounts
backend/internal/api/router.go - API routing → GCP and Azure accounts: routes cloud setup
backend/internal/api/router.go - API routing → Dashboard queries: routes dashboard
backend/internal/api/router.go - API routing → Recommendation actions: routes recommendations
backend/internal/api/router.go - API routing → PostgreSQL repositories: initializes repositories
backend/internal/api/router.go - API routing → AWS cost ingestion: initializes service
backend/internal/api/router.go - API routing → GCP cost ingestion: initializes service
backend/internal/api/router.go - API routing → Azure cost ingestion: initializes service
backend/internal/api/router.go - API routing → Recommendation engine: initializes engine
backend/internal/api/router.go - GCP and Azure accounts → GCP cost ingestion: triggers cost fetch
backend/internal/api/handlers/multi_cloud_handlers.go - GCP and Azure accounts → Azure cost ingestion: triggers cost fetch
backend/internal/api/handlers/multi_cloud_handlers.go - Authentication → PostgreSQL repositories: reads and creates users
backend/internal/api/handlers/auth.go - AWS cost ingestion → AWS Cost Explorer: queries costs
backend/internal/services/cost_ingestion/aws_service.go - GCP cost ingestion → PostgreSQL repositories: stores costs
backend/internal/services/cost_ingestion/gcp_service.go - Azure cost ingestion → PostgreSQL repositories: stores costs
backend/internal/services/cost_ingestion/azure_service.go - Recommendation engine → PostgreSQL repositories: reads and writes
backend/internal/services/recommendations/engine.go - HTTP server → PostgreSQL database: connects database
backend/cmd/api/main.go - PostgreSQL repositories → PostgreSQL database: persists product data