An inventory application
- Application live url - https://inventory-staging-api.onrender.com
- Documentation - https://inventory-staging-api.onrender.com/docs
Before starting, make sure you have at least those components on your workstation:
- An up-to-date release of Go
- A database (MongoDB).
Start by cloning this project on your workstation.
git clone https://github.com/emmabraboke/inventory-api
The next thing will be to install all the dependencies of the project.
cd inventory-api
go get
Once the dependencies are installed, you can now configure your project by creating a new .env
file containing your environment variables used for development.
cp .env.example .env
vi .env
You are now ready to launch the go application using the command below.
# Run the
$ go run main.go
You can now head to http://localhost:5000/docs
and see your API Swagger docs.
This template was made with a well-defined directory structure.
├───cmd
│ ├───handlers
│ │ ├───customerHandler
│ │ ├───invoiceHandler
│ │ ├───productHandler
│ │ ├───saleHandler
│ │ ├───transactionHandler
│ │ └───userHandler
│ ├───middlewares
│ └───routes
├───docs
├───internals
│ ├───database
│ │ └───mongo
│ ├───entity
│ │ ├───customerEntity
│ │ ├───invoiceEntity
│ │ ├───productEntity
│ │ ├───responseEntity
│ │ ├───saleEntity
│ │ ├───transactionEntity
│ │ └───userEntity
│ ├───enum
│ ├───repository
│ │ ├───customerRepo
│ │ │ └───mongoRepo
│ │ ├───invoiceRepo
│ │ │ └───mongoRepo
│ │ ├───productRepo
│ │ │ └───mongoRepo
│ │ ├───saleRepo
│ │ │ └───mongoRepo
│ │ ├───transactionRepo
│ │ │ └───mongoRepo
│ │ └───userRepo
│ │ └───mongoRepo
│ └───service
│ ├───cryptoService
│ ├───customerService
│ ├───invoiceService
│ ├───paymentService
│ ├───productService
│ ├───saleService
│ ├───tokenService
│ ├───transactionService
│ ├───userService
│ └───validationService
└───utils
- Golang
- mongoDB