This application provides REST API for Company Asset Management System. Among its features are
- User: Login, get user detail by user id, get all users, update user, get history of past requests of user
- Asset: Create asset, get asset detail by asset short-name, get all assets and filter them by category, update maintenance status of asset, get asset statistics, get asset usage history
- Request: Request to borrow/procure an asset, get borrow/procure request detail by request id, get all borrow/procure requests and filter them by status or request date or asset category, update status of borrow/procure request.
See open API documentation here. Run Postman collection .
To run the application, clone this repository first,
git clone https://github.com/bagusbpg/group3-capstone-project-be.git
Then, set up configuration file in JSON.
{
"app_port": ,
"jwt_secret": ,
"database": {
"db_driver": ,
"db_host": ,
"db_port": ,
"db_username": ,
"db_password": ,
"db_name":
},
"aws": {
"aws_accesskeyid": ,
"aws_secretkey": ,
"aws_region": ,
"aws_bucket":
}
}
or using environment variables,
PORT=
JWT_SECRET=
DB_DRIVER=
DB_HOST=
DB_PORT=
DB_USERNAME=
DB_PASSWORD=
DB_NAME=
AWS_ACCESSKEYID=
AWS_SECRETKEY=
AWS_REGION=
AWS_BUCKET=
Download the required libraries or packages
cd group3-capstone-project-be
go mod tidy
go get
Create the database along with all necessary tables as defined in ERD. Then, run the application
source <env-file>
go run ./app/main.go
To run the application using docker, build the docker image first,
docker build -t <image-name>[:tag] .
Then run docker image as container,
docker run -d --env-file <env file> -p <host-port>:<container-port> --name <container-name> <image-name>
©️ 2022