1
0
Fork 0
forked from goffee/cup
This commit is contained in:
Zeni Kim 2024-09-16 18:36:38 -05:00
parent a756cd418d
commit 3360d106c0
2 changed files with 8 additions and 11 deletions

View file

@ -6,7 +6,7 @@ Cup is a skeleton project for the Goffee [Go](https://go.dev) framework made fo
## Main Features
- Routing
- Middlewares
- Hooks
- Data Validation
- Databases ORM ([GORM](https://gorm.io/) integrated)
- Emails
@ -64,8 +64,8 @@ The architecture is similar to `MVC`, where there is a routes file `./routes.go`
## The request journey:
The first component that receive's the request in `Cup` is the `Router`,
then `Goffee` locates the matching [handler](https://gocondor.github.io/docs/handlers) of the request and it check's if there are any [middlewares](https://gocondor.github.io/docs/middlewares) to be executed either before or after the [handler](https://gocondor.github.io/docs/handlers), if so, it executes them in the right order, then at the final stage it returns the response to the user.
`Request -> Router -> Optional Middlewares -> Handler -> Optional Middlewares -> Response`
then `Goffee` locates the matching [handler](https://git.smarteching.com/goffee/docs/handlers) of the request and it check's if there are any [hooks](https://git.smarteching.com/goffee/docs/hooks) to be executed either before or after the [controller](https://git.smarteching.com/goffee/controllers), if so, it executes them in the right order, then at the final stage it returns the response to the user.
`Request -> Router -> Optional Hooks -> Controller -> Optional Hooks -> Response`
## Folder structure
```bash

5
go.mod
View file

@ -1,19 +1,16 @@
module git.smarteching.com/goffee/cup
replace (
git.smarteching.com/goffee/core => ../core
git.smarteching.com/goffee/cup/config => ./config
git.smarteching.com/goffee/cup/handlers => ./handlers
git.smarteching.com/goffee/cup/middlewares => ./middlewares
git.smarteching.com/goffee/cup/models => ./models
)
go 1.23.1
require (
git.smarteching.com/goffee/core v1.7.2
git.smarteching.com/goffee/core v1.7.3
github.com/google/uuid v1.6.0
github.com/joho/godotenv v1.5.1
github.com/julienschmidt/httprouter v1.3.0