Vessel Management service is a service to serve information about vessel related stuffs
Business logic for Vessels
Below is a list of stable APIs
No | Method | Endpoint | Description | Parameters |
---|---|---|---|---|
1 | POST | /v1/vessels | Create new vessel | name (string), owner_id (int), naccs_code (string) |
2 | GET | /v1/vessels | Get a list of vessels | name (string), owner_id (int), offset (int), limit (int) |
3 | GET | /v1/vessels/{id} | Get a single vessel | id (int) |
4 | PUT | /v1/vessels/{id} | Update a vessel | id (int), name (string), owner_id (int), naccs_code (string) |
Voyage APIs is still in progress ;)
- Go 1.19
- Docker
- Docker Compose
- Clone this repository
git clone git@github.com:joshiaj7/vessel-management.git
- Copy env variable
cp env.sample .env
- Build dependencies
- Golang dependecy
go mod tidy
go mod vendor
-
Unlisted Go Dependencies
-
Service dependencies
docker-compose up --build
- Check everything is OK
make test
You can run it using docker-compose
docker-compose up
Migrating database You can use helper.sh to help migrating DB
source helper.sh
migrate-up
Try make a request using your favourite method (Postman, curl, etc.)