Microservice used for working with user data.
In root of your local repository add config.json
file.
{
"consul_address": "localhost:8500",
"logit_address": "5571bfef-c40a-4d84-a5dc-6b5dd6453ac0-ls.logit.io:24240",
"db_driver": "postgres",
"db_source": "postgres://root:secret@localhost:5432/electric_station?sslmode=disable",
"server_address": "0.0.0.0:8080",
"gin_mode": "debug"
}
- Run
docker pull postgres:alpine
to download postgres image. - Run
make postgres
to run postgres image inside of container. - Run
make createdb
to create postgres database. - Run
make migrateup
to add "users" table. - Run
go mod tidy
to clean golang package dependecies. - Test project with command
make test
. - Run service with
go run .
. - Use PostMan to send query to
http://localhost:8080/v1/users/
.
Populate database with some users. You can run this query in TablePlus.
INSERT INTO users("username", "password", "email")
VALUES ('Mario', 'passgancipass', 'ganci@gmail.com'),
('Johnny', 'john123', 'johnny@gmail.com'),
('Donald Trump', 'trumpyboy', 'trump@hotmail.com'),
('Obama', 'barackog44', 'obama@gmail.com');
- CRUD operations
- Database migrations
- CRUD unit tests
- Makefile
- Health checks
- Docker file
- CI github actions
- Dockerhub
- AWS account
- Kubernetes cluster in AWS
- Metrics (Prometheus in Go)
- CD github actions
- Config server (dynamic configuration)
- API unit tests