cleanarchGo
💫
About
Clean architecture starter pack for faster and easier feature creation using Go.
- This pack includes Clean Architecture with the Echo framework, Gorm, Viper (env), Govalidator, Jwt, and more.
- You can create CRUD features in less than one minute
.gitignore
,Dockerfile
will also be generated too.- Auth feature and users feature will also generated :
🔗
Auth Routes
Method | Endpoint | Params | JWT Token | Function |
---|---|---|---|---|
POST | /login | - | NO | Login User |
POST | /register | - | NO | Register User |
POST | /change-password | - | YES | Change Password |
GET | /claim-token | - | YES | Get Token Data |
🔗
Users Routes
Method | Endpoint | Params | JWT Token | Function |
---|---|---|---|---|
GET | /users | - | NO | Get All Users |
GET | /users | id | NO | Get User By Id |
PUT | /users | id | NO | Edit User |
DELETE | /users | id | NO | Delete user |
🚀
Import
go get -u github.com/Findryankp/[email protected]
👨🏽💻 Step By Step
- First step, add this syntax to your
main function
in filemain.go
cleanarchGo.Init();
- for example :
- Run this syntax in cmd/ terminal
go run . init
- If success, the files that will be generated are :
- configs database
- middlewares (jwt auth, logs, cors)
- environment (local.env)
- etc
- Set
local.env
with your own configuration database
🚀
Create new feature
- run this syntax in your cmd/terminal
go run . features featuresNames
-
ex :
go run . features rooms
-
CRUD Features, Code all layer, route, and migratiton feature from your featureNames will be created
🔗
featureNames Routes
Method | Endpoint | Params | JWT Token | Function |
---|---|---|---|---|
POST | /featureNames | - | NO | Create new featureNames |
GET | /featureNames | - | NO | Get All Available your featureNames |
GET | /featureNames | id | NO | Get featureNames Detail |
PUT | /featureNames | id | NO | Edit featureNames |
DELETE | /featureNames | id | NO | Delete featureNames |
🎯
Run Project
go run .
- try with your postman or another