Skip to content

Raphy42/industrial-fizz-buzz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FizzBuzz SaaS

Production grade fizzbuzz

Usage

The docker compose stack runs both the api, a small client written in typescript using Deno which emulates some load, and a godoc container rendering the package documentation. The api container should be around 16Mo while the client

# running the stack
mv .env.example .env
docker compose up -d

Links (assuming default .env config and a running docker-compose stack)

Implementation

Third parties

  • Mux/Routing/HttpBody: echo
  • Logging: zap
  • Testing: testify
  • Config: envconfig
  • go 1.20+ (generics)
  • openapi3.json automatic generation at runtime

core package

Contains various conveniences and helpers.
It can be refactored into its own package/applicative-framework if the core/config package becomes more generalised, and not fizzbuzz specific.

  • errors: convenience error wrapper
  • config: runtime config from environment + sane defaults
  • http: generic handler + server abstraction
  • logger: logging layer initialisation + helpers
  • semconv: formatting keys and naming things
  • generics: slice/maps generic utilities

cmd package

Package for everything binary related: servers, migration runners, scripts...

  • server: the actual http server

Environment

# see core/config/env.go for the complete list
# and default values
FIZZBUZZ_MODE=prod|dev
FIZZBUZZ_PORT=8080
# supersedes FIZZBUZZ_PORT
FIZZBUZZ_ADDR=:8080
# defaults to true
FIZZBUZZ_CORS_ENABLED=true|false

About

Production Grade FizzBuzz show reel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published