How gakuto06250177/hackbar-copilot works
Project type and purpose
• This is primarily a GraphQL-based backend service implemented in Go using a hexagonal (ports-and-adapters) architecture. It exposes a GraphQL HTTP API (via gqlgen), persists data to the filesystem (TOML), and offers both a CLI (cmd/tui) and a TypeScript client package (client/) with generated query/mutation code.
File structure
• Top-level:
• cmd/registry – the main HTTP GraphQL server
• cmd/tui – an interactive CLI client
• client/ – TypeScript GraphQL client code (+ codegen tools)
• internal/domain – core domain entities and business rules
• internal/usecase – application services/use-case implementations
• internal/interface-adapter – GraphQL resolvers, JWT middleware
• internal/infrastructure/datasource – filesystem repositories
• internal/infrastructure/api/http – HTTP server setup
• Patterns:
• Hexagonal layering (domain/usecase/adapters/infrastructure)
• Repository pattern for persistence
• Code generation for GraphQL and client interfaces
README for additional insights
• Running cmd/registry serves /playground for GraphQL queries/mutations
• Sample queries/mutations show recipe/menu/order/cash‐out workflows
Elements
• Clear labels: e.g., “GraphQL Client”, “gqlgen Resolvers”, “Use-Case: saveRecipe”, “Domain: Recipe”, “Filesystem Repository”
• Client → Server (HTTP request)
• Resolvers → Use-cases → Domain → Repositories → Filesystem
• CLI → Use-cases or Server
• Application layer (use-cases) in another