You can check it at GridU public repository
Application is made of two microservices
Directory naming follows project-layout standatrs
API documentation for each microservice can be found if api
directories
Important: for the study purpose I used the same database for locations and logging. In a real project it must be separated storages
You can run all the required infrastructure using the command
make dev-services
it will start both databases and the monitoring services.
- Open
http://localhost:8007
to access the adminer panel - Open
http://localhost:8004
to access the kibana panel
There is a migration app in tools/migrate/migrate.go
, which allows you to control the users
database structure.
Source to the library and documentation
TLDR:
- Files in
users/migrations
represent migrations. Bothup
anddown
migrations required go run tools/migrate/migrate.go up
to setup databasego run tools/migrate/migrate.go 7
to set specific versiongo run tools/migrate/migrate.go drop
you never want to use it on your production server
make run-locations
to run the locations servicemake run-users
to run the users service
Tests do not require database being up and migrated, because in unit cases the fake storage is always used.
You can run testing by make-test
command
For these you need the test-db set up
docker-compose -f deploy/docker-compose.yml up db_test -d
go run tools/migrate/migrate.go up test
make test-integration
Make sure you run tests with make
command, or you provided integration
tag. Otherwise, the tests won't be run.
Just run make release
and wait until the message that both servers are ready arrive.
- You can access the
users
service on port 8000 - And
locations
service on port 8001