A RealWorld implementation written with Go and go-kit!
This project utilizes several popular Go-based libraries and technologies, primarily including:
- Go kit as a general application framework
- Chi for routing
- sqlx for querying
- Fly for hosting
- Docker for containerization
- PlanetScale for database hosting
- Taskfile for task orchestration
- golangci-lint for linting
- pre-commit for code quality git hooks
To get started, verify that Docker and Go 1.20 are installed. Next, install the Taskfile CLI and golangci-lint:
go install github.com/go-task/task/v3/cmd/task@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
Next, set your .env
file:
mv .env.example .env
PlanetScale is based on MySQL, but any old MySQL database will. Run the SQL in the schema file to create all the necessary tables. If you're using PlanetScale, simply setup an account and add your connection strings to the .env file.
Once the tool are installed, run the application as a task:
task run
That's it! Checkout the Taskfile to see the various tasks available for running. To run integration tests against the running server, open a new terminal and run:
task integration:local
All tests should pass and there is CI setup to run integration tests against the deployed instance on Fly.