How jamiewhitney/fairways-core works
Based on our analysis of the file tree and README, this project is a backend microservices system for a golf course management platform (Fairways). It consists of several Go-based microservices, each with a specific domain responsibility—such as pricing, booking, catalog, and tee time management—as well as a gRPC gateway that translates HTTP requests to gRPC calls. The project is containerized (with Docker and Kubernetes manifests), uses SQL migrations (with SQLC for query generation), and shares common components (via the pkg directory) for things like authentication, configuration, logging, and database connectivity.
Main Components
• Frontend/API Gateway:
• “gateway” service that exposes an HTTP endpoint and translates requests into gRPC calls.
• Backend Microservices:
• Bookings Service: Manages tee time bookings.
• Catalog Service: Handles course information.
• Pricing Service: Manages pricing rules (base and dynamic pricing).
• Tee Time Service: Generates available tee times and related pricing.
• Shared Components/Libraries:
• Common packages (pkg directory) that provide functionality such as authentication (auth-jwt), configuration, database connectivity (pkg/database), logging, caching, pubsub, and secret management.
• Database and Data Persistence:
• MySQL: Indicated in the build directory and migrations. Each service may use distinct repositories or schemas.
• Inter-Service Communication:
• gRPC interfaces as defined in the protobufs directory.
• The gRPC gateway as a facade to communicate with internal services.
• Infrastructure & Deployment:
• Containers (docker-compose, Dockerfile) and Kubernetes manifests (under deploy/kubernetes) illustrate the containerized deployment.
• Terraform manifests for infrastructure management.
Component Interactions and Data Flow
• For each microservice, show:
▪ Use of common packages (such as pubsub or secretstore) by each service.
Architectural Patterns and Design Principles
• Microservices architecture with clear service boundaries.
• That each microservice follows a layered structure (config, repository, service, and server) which may be represented as internal sub-components if desired.
• Use of code generation (SQLC and protobufs) and how that drives consistency in data access and service contracts.
• Separation between the HTTP API layer (managed by the gateway) and internal gRPC calls.
Relevant Technologies and Frameworks
• Go as the programming language for services.
• gRPC and Protocol Buffers for structured communication.
• MySQL as the database backend, with SQL migrations and SQLC-generated queries.
• Docker and Kubernetes for containerization and orchestration.
• Terraform for infrastructure management.
• Common tooling (e.g., logging, environment configuration, and secret stores like Vault or AWS Secrets Manager) as part of the supporting framework.