SEA Store is a simple ecommerce project created as a final project for Software Engineering Academy Compfest 2020. SEA Store have 18 user stories covering Users, Items and Transactions. This repository mainly discuss about transactions microservice.
Item Microservice is a service that focus on maintan items. All operation related to items (e.g. create items, edit items, delete items, etc) are handled by this service. This service is using Golang and Postgresql as its tech stack and using REST API as a way to communicate between services.
There is only 1 table with its attributes that can be seen in the picture above.
There are 11 endpoints available in this services. 9 of them are covered in this swag documentation. 2 Extra endpoints are
- /api/docs/index.html To check api available with its requirements and description.
- /api/metrics
To check the metrics of this microservice. Outputs are prometheus datasource.
There 3 stages in CI CD process.
-
Test
This stage is to make sure that all unit test available for this project are passed successfully before building the project. This process will take the coverage given by the unit test and put it in the repository badges. -
Build
This stage is to make sure that all the code are successfully translated into binary and can be executed. -
Deploy
There are 2 jobs in this stage. One is for deploying to staging and the other for deploying to production. This stage handle making container for the project and push it to heroku container.
- Make sure docker and docker compose are availables in your machine. If not check these documentation from docker. docker-engine docker-compose
- Make sure go are installed in your machine. Check this documentation if you dont have go. golang
- Copy the .env.example file and rename it to .env
- Edit the credentials in .env based on your needs or use the default ones.
- If you used the default database environment please run
docker-compose up -d postgre
. If not you can proceed to the next step - run
go mod tidy
- run
go run main.go
Production Links: https://sea-store-backend-items.herokuapp.com/