- Media-uploader
- golang clean-architecture
- Database : Postgresql version 14
- Storage : GCP cloud storage
- Framework : Echo, Gorm
: should update 'create object access' to GCP storage.
-
Navigate to 'IAM & Admin' > 'Service Account'
-
Create service account
a. Set 'Cloud Storage' > 'Storage Admin' access
-
Click Manage Key
-
Move to 'Key' tab
-
Click 'Add Key' (JSON file will be generated)
-
Copy JSON & Paste JSON under 'config' directory
reference
: made new architecture based on these references.
- https://github.com/manakuro/golang-clean-architecture
- https://github.com/bxcodec/go-clean-arch/tree/9e174b8b0bbdfbab69bc293bb2905b2bb622155c
- https://github.com/evrone/go-clean-template/tree/3a9a40d72d21bb2d620fa76c4c3214e956a2e2e5
Frameworks & Drivers -> Interface Adapter -> Application Business Rules -> Enterprise Business Rules
= DB, Devices(Mobile, Desktop), Web
- We call it
infrastructure
- End side of architecture
- Handle raw data or APIs
= Controllers, Gateways, Presenters
- We call it
adapter
- Controll the value between data source and business rule handler
- Take role of adapter that connect outer data and business logic
= Use Cases
- We call it
usecase
- Business logic handler
- Show purpose of this server
= Entities
- We call it
domain
- 'Enterprise' == No one except our company shouldn't know
: store data of configuration
: stand for 'Entities'
- model
: stand for 'Framework & Drivers'
- datastore : create db instances
- router : define routing requests
: stand for 'Interface Adaper' which takes role of translator btw domain
and infrastructure
. data fit for usecases & entities
-> data fit for DB & Web
-
presenter
- format strings & dates
- add presentation data like flags
- prepare the data to be displayed in the UI
-
controller
- handle API requests
- receive the user input like DTO
- validate user input
- convert the user input into model that use in usecase
- call the usercase and pass it
: stand for 'Use cases' that define what this server for(objective functions) business logic located in here.
- interactor : input port(입력값이 들어오는 구간)
- presenter : output port(반환값이 통과하는 구간)
- repository : store db handler as a gateway