How golangid/candi works
Candi is a Go service-framework library accompanied by a CLI that generates services, modules, handlers, and monorepo scaffolding. Its runtime workflow is to assemble registered applications, serve network protocols or consume scheduled and broker/database events, and shut them down gracefully. The graph includes the documented REST, GraphQL, gRPC, and worker capabilities, plus factories and tracing. Source excerpts are limited, so connections among unsampled protocol workers, handlers, and integrations are shown only where the tree or excerpts support them.
Main entry points: service_factory.go Service Factory · main.go CLI Entry · graphql_server.go GraphQL Server · postgres_worker.go Postgres Listener
Components 24
Project CLI
- CLI Entry
cmd/candi/main.go - Project Generator
cmd/candi/project_generator.go - Project Templates
cmd/candi/template_service.go - Service Runner
cmd/candi/service_runner.go
Runtime Lifecycle
- Application Lifecycle
codebase/app/app.go - Service Factory
codebase/factory/service_factory.go - Application Factory
codebase/factory/app_server_factory.go - Module Factory
codebase/factory/module_factory.go
Servers and Workers
- REST Server
codebase/app/rest_server/rest_server.go - GraphQL Server
codebase/app/graphql_server/graphql_server.go - gRPC Server
codebase/app/grpc_server/grpc_server.go - Cron Worker
codebase/app/cron_worker/cron_worker.go - Kafka Worker
codebase/app/kafka_worker/kafka_worker.go - RabbitMQ Worker
codebase/app/rabbitmq_worker/rabbitmq_worker.go - Redis Worker
codebase/app/redis_worker/redis_worker.go - Postgres Listener
codebase/app/postgres_worker/postgres_worker.go - Task Queue Worker
codebase/app/task_queue_worker/task_queue_worker.go
Shared Platform
- Middleware
middleware/middleware.go - Tracing
tracer/tracer.go - Broker Adapters
broker/broker.go - Handler Contracts
codebase/interfaces/handlers.go
Other components
- Service Developer
- API Clients
- Event Sources
Connections 26
- Service Developer → CLI Entry: invokes
- CLI Entry → Project Generator: dispatches generation
- Project Generator → Project Templates: renders templates
- CLI Entry → Service Runner: dispatches run
- Service Developer → Service Factory: configures service
- Application Lifecycle → Service Factory: gets applications
- Service Factory → Application Factory: registers applications
- Service Factory → Module Factory: assembles modules
- Application Lifecycle → Application Factory: serves and shuts down
- API Clients → REST Server: sends HTTP
- API Clients → GraphQL Server: sends GraphQL
- API Clients → gRPC Server: sends RPC
- Event Sources → Kafka Worker: delivers messages
- Event Sources → RabbitMQ Worker: delivers messages
- Event Sources → Redis Worker: publishes events
- Event Sources → Postgres Listener: emits changes
- Event Sources → Cron Worker: triggers schedule
- Event Sources → Task Queue Worker: queues tasks
- GraphQL Server → Module Factory: collects resolvers
- Postgres Listener → Handler Contracts: dispatches handlers
- REST Server → Middleware: applies middleware
- GraphQL Server → Tracing: traces requests
- Postgres Listener → Tracing: traces events
- Kafka Worker → Broker Adapters: uses adapter
- RabbitMQ Worker → Broker Adapters: uses adapter
- Redis Worker → Broker Adapters: uses adapter