Clean architecture with a basic greeter API service example
View Example
·
Report Bug
·
Request Feature
Table of Contents
Graph generated by go-arch-lint
utility
Setting up your project locally. To get a local copy up and running follow these simple example steps.
Prepare some useful tools for project development
- install project dependencies (Taskfile and go-arch-lint)
Taskfile *recommended
golangci-lint *optional
go-arch-lint *optional
-
Clone the repo
git clone https://github.com/iqhater/clean-arch-basic-example.git
-
Install project dependencies
task install
-
Add
.env
file to project root. See.env.example
-
*Optional Feel free to edit
Taskfile
binary name, module name and entrypoint path if you wish.MODULE_NAME: greeter_api # Binary name BINARY_NAME: greeter_api # App entrypoint path APP_ENTRYPOINT: ./cmd/greeter
-
Build and run project
task run
Clean arch data flow concept schema
curl "http://localhost:8080/greet?name=Bob"
{
"request_id":"1ddb50f2-6fde-4fda-9d5c-51a23fcaa935",
"greeting":"👋 Hello Gopher Bob!"
}
curl "http://localhost:8080/greet/1?name=Bob"
{
"id":1,
"greeting":"👋 Hello Gopher Bob!",
"total_greetings":3
}
Run all tests
task test
Run project linter
task lint
Remove all binaries
task clean
- Deploy openapi static docs located at the
/api
folder - Deploy greeter API service
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
email - [email protected]
Project Link: https://github.com/iqhater/clean-arch-basic-example