Accounts and authentication for weeb.vip: registration, sign-in, JWT issuing and the user records behind them.
A Go GraphQL service built with gqlgen, backed by MySQL. It publishes user events to Kafka so the rest of the system can react to a new account without this service knowing who is listening, and uses MinIO for object storage.
The tokens it issues are what gateway-proxy validates on the way in.
Requires Go and a MySQL instance. .db_init.sql sets up the schema a local
database needs.
make migrate # bring the database up to date
go run cmd/cli/main.go server # GraphQL server, port 3002 by default
air # the same, with live reload
go run cmd/cli/main.go user-created-event # the Kafka consumerdocker-compose.local.yaml brings up the dependencies for local work.
The GraphQL schema lives under graph/, and the resolvers around it are
generated:
make gql # regenerate from the schema
make mocks # regenerate the test mocksBoth outputs are committed, so a schema change means regenerating and committing the result with it.
make create-migration name=add_something
make migrateMigration files live in internal/migrations/scripts, run by
golang-migrate.
config/config.go defines the shape; config/config.dev.json and
config/config.docker.json are the checked-in variants, and environment
variables override them.
go test ./...
golangci-lint run # config in .golangci.json.pre-commit-config.yaml wires the same checks into a pre-commit hook.