Profile
Back to NewsBack
GitHub Trending 2 min
Reader Mode
goravel/example: An example for Goravel

goravel/example: An example for Goravel

16 hours ago

English | 中文

About Goravel

Goravel is a web application framework with complete functions and good scalability. As a starting scaffolding to help Gopher quickly build their own applications.

The framework style is consistent with Laravel, let Phper don't need to learn a new framework, but also happy to play around Golang! Tribute Laravel!

Welcome to star, PR and issues!

Getting Started

Start Service

go run . or air

[About air]: https://www.goravel.dev/getting-started/installation.html#live-reload

DB

app/http/controllers/db_controller.go

Websocket

app/http/controllers/websocket_controller.go

Validation

app/http/controllers/validation_controller.go

Auth

app/http/controllers/auth_controller.go

Unit Test (Testing With Mock)

Examples of mocking facades using mock.Factory() with EXPECT-style syntax:

app/services/mock_examples_test.go

Covers 18 facades: App, Artisan, Auth, Cache, Config, Crypt, Event, Gate, Grpc, Hash, Lang, Log, Mail, Orm, OrmTransaction, Queue, Storage, Validation, and View.

Integration Test (Testing With Configuration)

tests/controllers/validation_controller_test.go

GRPC

app/grpc/controllers/user_controller.go

Swagger(For gin HTTP driver)

app/http/controllers/swagger_controller.go

Integration of single page application into the framework

routes/web.go

View nesting

routes/web.go

Session

routes/web.go

Cookie

routes/web.go

Localization

routes/api.go

GraphQL

# download and install gqlgen locally, only need to run it once
go get -d github.com/99designs/gqlgen

regenerate code

go run github.com/99designs/gqlgen generate

Documentation

Online documentation https://www.goravel.dev

To optimize the documentation, please submit a PR to the documentation
repository https://github.com/goravel/docs

Group

Welcome more discussion in Discord.

https://discord.gg/cFc5csczzS

License

The Goravel framework is open-sourced software licensed under the MIT license.

Chat with me