Golang boilerplate
MIT License
This project is a boilerplate for creating API projects in Go, incorporating key principles of Domain-Driven Design and Clean Architecture. It reflects my expertise in Golang, drawn from previous projects, and is structured to facilitate maintainability and scalability.
All layers of the codebase are tested to ensure reliability and robustness. The project is open to contributions and improvements. Feel free to fork the repository, submit pull requests, or open issues to discuss enhancements or report bugs.
For the presentation layer, which I refer to as the transport layer, its purpose is to handle data transportation. It is responsible for receiving and responding to various types of requests, including API calls, gRPC, and messaging via RMQ, among others.
For unit tests with MySQL and Redis, we are using real dependencies with testcontainers. It’s like putting our functions through a real-world. And we are also using mocks to test the errors scenarios, this way we can achieve 100% of cover. 💪
To start the application, execute the command:
docker-compose up
Once you see the message your server started on [::]:5000
, the application is up and running!
For detailed API endpoint documentation, navigate to the /docs
directory where you will find the Swagger documentation.
These swagger docs was generated using goswag
make tests
make docs
Contributions are welcome! Here are several ways you can contribute:
git clone https://github.com/<your_username>/go_boilerplate
git checkout -b new-feature-x
git commit -m 'Implemented new feature x.'
git push origin new-feature-x
Once your PR is reviewed and approved, it will be merged into the main branch.
This project is protected under the MIT License License. For more details, refer to the LICENSE file.