https://github.com/iqhater/clean-arch-basic-example
Basic greeter API service example (clean arch)
https://github.com/iqhater/clean-arch-basic-example
api clean-arch clean-architecture-template example go golang openapi redoc taskfile
Last synced: 6 months ago
JSON representation
Basic greeter API service example (clean arch)
- Host: GitHub
- URL: https://github.com/iqhater/clean-arch-basic-example
- Owner: iqhater
- License: mit
- Created: 2024-12-13T14:34:04.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-01-16T18:29:48.000Z (9 months ago)
- Last Synced: 2025-02-07T20:33:52.314Z (8 months ago)
- Topics: api, clean-arch, clean-architecture-template, example, go, golang, openapi, redoc, taskfile
- Language: Go
- Homepage:
- Size: 4.18 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![Tests][tests-shield]][tests-url]
Clean Arch Basic Example
Clean architecture with a basic greeter API service example
View Example
ยท
Report Bug
ยท
Request Feature
Table of Contents
## About The Project
Graph generated by `go-arch-lint` utility
[![Product Name Screen Shot][product-screenshot]](https://example.com)### Built With
* [![Go][go.dev]][Go-url]
## Getting Started
Setting up your project locally.
To get a local copy up and running follow these simple example steps.### Prerequisites
Prepare some useful tools for project development
* install project dependencies (Taskfile and go-arch-lint)
[Taskfile](https://taskfile.dev/installation/) _`*recommended`_
[golangci-lint](https://golangci-lint.run/welcome/install/) _*optional_
[go-arch-lint](https://github.com/fe3dback/go-arch-lint) _*optional_### Installation
1. Clone the repo
```sh
git clone https://github.com/iqhater/clean-arch-basic-example.git
```2. Install project dependencies
```sh
task install
```3. Add `.env` file to project root. See `.env.example`
4. *Optional Feel free to edit `Taskfile` binary name, module name and entrypoint path if you wish.
```yml
MODULE_NAME: greeter_api# Binary name
BINARY_NAME: greeter_api# App entrypoint path
APP_ENTRYPOINT: ./cmd/greeter
```5. Build and run project
```sh
task run
```## Usage
Clean arch data flow concept schema
[![Clean Arch Schema Concept][schema-concept]](https://bloghugocoutinho.wordpress.com/wp-content/uploads/2020/05/cleanarchitecture-1.jpg)#### Request public greeting example
```sh
curl "http://localhost:8080/greet?name=Bob"
```#### Response
```json
{
"request_id":"1ddb50f2-6fde-4fda-9d5c-51a23fcaa935",
"greeting":"๐ Hello Gopher Bob!"
}
```#### Request private greeting example
```sh
curl "http://localhost:8080/greet/1?name=Bob"
```#### Response with counter
```json
{
"id":1,
"greeting":"๐ Hello Gopher Bob!",
"total_greetings":3
}
```### Taskfile useful commands
Run all tests
```sh
task test
```Run project linter
```sh
task lint
```Remove all binaries
```sh
task clean
```## Roadmap
* [ ] Deploy openapi static docs located at the `/api` folder
* [ ] Deploy greeter API serviceSee the [open issues](https://github.com/iqhater/clean-arch-basic-example/issues) for a full list of proposed features (and known issues).
## Contributing
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!1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request### Top contributors
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
## Contact
email -
Project Link: [https://github.com/iqhater/clean-arch-basic-example](https://github.com/iqhater/clean-arch-basic-example)
[issues-shield]: https://img.shields.io/github/issues/iqhater/clean-arch-basic-example.svg?style=for-the-badge
[issues-url]: https://github.com/iqhater/clean-arch-basic-example/issues
[license-shield]: https://img.shields.io/github/license/iqhater/clean-arch-basic-example.svg?style=for-the-badge
[license-url]: https://github.com/iqhater/clean-arch-basic-example/blob/main/LICENSE.txt
[tests-url]: https://github.com/iqhater/clean-arch-basic-example/actions/workflows/develop_run_tests.yml/badge.svg
[tests-shield]: https://github.com/iqhater/clean-arch-basic-example/actions/workflows/develop_run_tests.yml/badge.svg
[product-screenshot]: go-arch-lint-graph.svg
[schema-concept]: clean_arch_concept_go_vector.svg
[go.dev]: https://img.shields.io/badge/golang-00ADD8?style=for-the-badge&logo=go&logoColor=white
[Go-url]: https://go.dev