This project is a Golang REST API boilerplate using the Gin framework, with MongoDB as the database. It is designed for managing teams and user roles, and additionally handles product management for an e-commerce website. The product structure is directly compatible with Zoho Books item structure, making integration with Zoho seamless.
- User and role management
- Product management
- Integration-ready with Zoho Books
- Backend: Golang with Gin framework
- Database: MongoDB
- Go installed on your machine
- MongoDB set up and running
-
Install Go
sudo apt install golang-go
-
Set up environment path
export GOPATH=$HOME/go export PATH=$GOPATH/bin:$PATH
-
Set up environment variables
Create a
.env
file in the root directory and add the necessary environment variables. -
Install Air for auto-refresh and rerun setup
go install github.com/cosmtrek/air@latest
Set up the path
alias air='$(go env GOPATH)/bin/air'
Initialize Air
air init
Using Air for auto-refresh
air
Manual run
go run main.go
Server not ending issue
List open ports:
lsof -i
Kill the process by PID:
kill -9 <pid>
You can find the API documentation Link and Postman collection Link.
Contributions are welcome. Please fork the repository and create a pull request.
The server is deployed on Render machine. You can access it at server-link or BaseURL.
This project is licensed under the MIT License.
For detailed API usage and examples, refer to the Postman collection linked above. Happy coding!
For any inquiries or support, please contact mehulmeena064@gmail.com.