An efficient CLI starter template to kickstart your Go lang project using the Gin framework and MongoDB, enabling you to rapidly develop RESTful APIs.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Within this repository, you will find a fully configured and ready-to-use Go lang web application designed for building APIs. The project is built using the Gin framework and integrates with MongoDB, providing a solid foundation for developing scalable and performant APIs.
Here's why:
-
Routing & Middleware:
- ✔️ Gin for efficient routing and middleware support
-
Database Integration:
- 📦 MongoDB as the database for modern applications
- 💾 MongoDB driver for Go for seamless integration
-
Development Workflow:
- 🔄 Live reload for efficient development
- 🛠 Optimized code for production
-
Security Measures Added:
- 🔒 Input validation to prevent common security vulnerabilities
- 🚧 Rate limiting to protect against brute-force attacks
- 🌐 CORS (Cross-Origin Resource Sharing) configured for secure API usage
Of course, this template may not cover all project needs, as your requirements may vary. More updates will be added in the future. Feel free to suggest changes by forking this repo, creating a pull request, or opening an issue. Thanks to all contributors who have helped enhance this template!
This section highlights the key frameworks and libraries that form the foundation of your project. Below are some notable examples:
- : An open-source programming language that makes it easy to build simple, reliable, and efficient software.
- : A web framework written in Go (Golang). It features a Martini-like API with much better performance.
- : The database for modern applications.
- : The official MongoDB driver for Go.
Before you begin contributing to this project, make sure you have the following set up:
-
Clone the Repository:
git clone https://github.com/BoBsRepository/create-go-mongodb-template.git
-
Add Environment Variables:
cd create-go-mongodb-template touch .env
-
Add the necessary configuration:
MONGOURI = <your-mongodb-uri> JWT = KSNVLJDSBJVSDJLVNLKSDVNLKSDVVKMLSDMKDSNKLVDSNKLVNDSKLVDJK #your jwt secret
-
Fetch the Dependencies
go get
-
Build the Project:(optional)
The go build command is used in Go to compile and build a Go program. It creates an executable binary from the source code.
go build
-
Run the Project:
Now you can run that executable file or main.go file
./your-gin-executable
or
go run main.go
We welcome and appreciate contributions from the community ❤️! Here's how you can contribute:
- Open Issues: Check for open issues or create a new one to start discussions.
- Fork the Repository: Fork the project to your own GitHub account.
- Create Pull Request: Make changes in your fork and submit a pull request.
🚀 Thank you for considering contributing to this project! Your involvement makes this template even better. Feel free to explore the code, share your ideas, and make improvements ✌️.
🌟 Don't hesitate to reach out if you have any questions or need assistance. Together, let's make this project amazing!🟩