https://github.com/junnishimura/clean-architecture-with-go
Simple CRUD application built on Clean-Architecture
https://github.com/junnishimura/clean-architecture-with-go
clean-architecture clean-architecture-boilerplate crud-application golang sample
Last synced: 3 months ago
JSON representation
Simple CRUD application built on Clean-Architecture
- Host: GitHub
- URL: https://github.com/junnishimura/clean-architecture-with-go
- Owner: JunNishimura
- License: mit
- Created: 2023-09-09T11:31:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-10T14:39:24.000Z (3 months ago)
- Last Synced: 2025-02-10T15:34:07.734Z (3 months ago)
- Topics: clean-architecture, clean-architecture-boilerplate, crud-application, golang, sample
- Language: Go
- Homepage:
- Size: 361 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Template project of Clean-Architecture
This is a simple CRUD application build on a Clean-Architecture written in Golang.## :triangular_flag_on_post: DEMO
### 1. use Docker to set up an environment to run the application
```bash
> make init
> make up
```
### 2. Call API by curl command
#### create
```bash
> curl -i -XPOST -d '{"title": "test", "body": "this is a test article"}' localhost:8080/articles
```#### read
```bash
> curl -i -XGET localhost:8080/articles
> curl -i -XGET localhost:8080/articles/1
```#### update
```bash
> curl -i -XPUT -d '{"title": "updated title", "body": "this article is updated"}' localhost:8080/articles/1
```#### delete
```bash
> curl -i -XDELETE localhost:8080/articles/1
```## :book: Explanation
| layer | directory |
| ---- | ---- |
| Enterprise Business Rules | [entities](https://github.com/JunNishimura/clean-architecture-with-go/tree/main/entities) |
| Application Business Rules | [usecase](https://github.com/JunNishimura/clean-architecture-with-go/tree/main/usecase) |
| Interface Adapters | [adapter](https://github.com/JunNishimura/clean-architecture-with-go/tree/main/adapter) |
| Frameworks & Drivers | [driver](https://github.com/JunNishimura/clean-architecture-with-go/tree/main/driver) |### Enterprise Business Rules
Core business rules are implemented in this layer.### Application Business Rules
By describing the business logic API, this layer expresses what this software will achieve.### Interface Adapters
This layer describes the input(controller), output(presenter) and data presistence process(gateway).### Frameworks & Drivers
This layer describes establishing DB connections, configuring routing and using the framework.