Lingo is a web app. I don't know what it will do, but for now the goals are:
- single binary, many commands with different functionality, like: serving grpc, http and jobs.
- use proto as the main way to design api's.
- use proto to generate https gateways for the grpc servers.
- add all https services to swagger ui so they can be easily discovered and tested.
todo:
- make sure 3 tokens are set:
- registration
- authentication
- registration
The goal with the setup is that minimal tools are needed to run the project.
- install docker.
- install openssl, version 3 (for generating certificates and keys).
- install with brew.
- install atlas.
- run
setup.sh
. you should be able to run the setup as many times as you want.- Specified deps in the
buf.yaml
need to be covered in yourbuf.lock
file. If you get an error, runscripts/proto-buf-mod-update.sh
to generate thebuf.lock
file. - resulting generated files are in the
protogen
folder. - check changes with the buf linter:
scripts/proto-lint.sh
.
- Specified deps in the
- setup should have completed.
- run
docker-compose up
. - To view the open-api specs for various services, open localhost:8090 in the browser.
- List the services:
docker compose config | yq '.services[]|key + " | " + .image'
The goal is to have a good developer experience. That means that the developer should have to read minimal setup guides en be up and running as fast as possible.
- See the launch.json to debug with vscode
- to lint, run
./scripts/lint.sh
.
Test that require a database can use testcontainers.
- to run all tests, run
go run test ./...
.
Migrations are managed by atlas.
- to create a new migration, run
./scripts/new-migration.sh <app> <name of migration>
. - after you have written your migration, run
./scripts/hash-migration.sh <app>
.
Proto files are generated to go server and client code with buf. Buf also generates Openapiv2 files in yaml and json for every service.
- build the proto files with
./scripts/proto.sh
. - resulting go files are in
proto/gen/go/**/*.go
. - resulting Openapiv2 files are in
proto/gen/openapiv2/**/*{json,yaml}
- lint the proto files with
./scipts/proto-lint.sh
.