How bladerunner322/orange-team-microservices works
This repository implements an API Gateway plus Auth and Profiles microservices. The main user workflow is HTTP registration/login through the Gateway to Auth, followed by token validation and refresh/logout; authenticated profile operations are forwarded to Profiles. Auth also manages JWTs and refresh-token state, while Profiles reads and mutates user profiles in PostgreSQL. The README documents these capabilities; some wiring is shown only by the SOURCE INDEX, so unverified links are marked dashed.
Main entry points: bootstrap.go Gateway wiring · usecases Auth workflows · handlers HTTP handlers · auth_grpc.go Auth gRPC client
Components 23
HTTP Gateway
- HTTP handlers
services/gateway/internal/interfaces/http/handlers - HTTP middleware
services/gateway/internal/interfaces/http/middleware - Gateway wiring
services/gateway/internal/bootstrap/bootstrap.go - Auth gRPC client
services/gateway/internal/infrastructure/clients/auth_grpc.go - Profiles gRPC client
services/gateway/internal/infrastructure/clients/profiles_grpc.go
Authentication
- Auth gRPC API
services/auth/internal/interfaces/authgrpc/server.go - Auth workflows
services/auth/internal/application/usecases - User and token rules
services/auth/internal/domain - JWT manager
services/auth/internal/infrastructure/jwt/manager.go - User repository
services/auth/internal/infrastructure/postgres_repo/repository.go - Refresh-token repository
services/auth/internal/infrastructure/redis_repo/repository.go - Auth PostgreSQL
- Refresh-token Redis
User Profiles
- Profiles gRPC API
services/profiles/internal/interfaces/profilesgrpc/server.go - Profile workflows
services/profiles/internal/application/usecases - Profile rules
services/profiles/internal/domain/profile.go - Profile repository
services/profiles/internal/infrastructure/postgres_repo/repository.go - Profiles PostgreSQL
Shared Infrastructure
- gRPC client support
pkg/grpc/client/client.go - Identity context
pkg/grpc/authctx/context.go - Rate limiter
pkg/ratelimit/limiter.go - Gateway Redis
pkg/redis/client.go
Other components
- API caller
Connections 25
- API caller → HTTP handlers: sends HTTP
- HTTP handlers → HTTP middleware: uses middleware
- Gateway wiring → HTTP handlers: wires handlers
services/gateway/internal/bootstrap/bootstrap.go - Gateway wiring → HTTP middleware: wires middleware
services/gateway/internal/bootstrap/bootstrap.go - Gateway wiring → Auth gRPC client: wires client
services/gateway/internal/bootstrap/bootstrap.go - Gateway wiring → Profiles gRPC client: wires client
services/gateway/internal/bootstrap/bootstrap.go - HTTP handlers → Auth gRPC client: calls auth
- HTTP handlers → Profiles gRPC client: calls profiles
- Auth gRPC client → Auth gRPC API: calls gRPC
- Profiles gRPC client → Profiles gRPC API: calls gRPC
- Auth gRPC API → Auth workflows: executes workflows
services/auth/internal/interfaces/authgrpc/server.go - Auth workflows → User and token rules: applies rules
- Auth workflows → JWT manager: uses token manager
- Auth workflows → User repository: uses repository
- Auth workflows → Refresh-token repository: uses token store
- User repository → Auth PostgreSQL: reads and writes
- Refresh-token repository → Refresh-token Redis: reads and writes
services/auth/internal/infrastructure/redis_repo/repository.go - Profiles gRPC API → Profile workflows: executes workflows
services/profiles/internal/interfaces/profilesgrpc/server.go - Profile workflows → Profile rules: uses domain
- Profile workflows → Profile repository: uses repository
- Profile repository → Profiles PostgreSQL: reads and writes
services/profiles/internal/infrastructure/postgres_repo/repository.go - Gateway wiring → Gateway Redis: configures Redis
services/gateway/internal/bootstrap/bootstrap.go - Gateway wiring → Rate limiter: configures limiter
services/gateway/internal/bootstrap/bootstrap.go - Auth gRPC client → gRPC client support: creates connection
services/gateway/internal/infrastructure/clients/auth_grpc.go - gRPC client support → Identity context: propagates identity