Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laragol/laragol
Laravel clone in go
https://github.com/laragol/laragol
go laravel
Last synced: 9 days ago
JSON representation
Laravel clone in go
- Host: GitHub
- URL: https://github.com/laragol/laragol
- Owner: laragol
- Created: 2017-04-29T05:46:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-08T23:00:12.000Z (about 7 years ago)
- Last Synced: 2024-07-31T12:08:05.074Z (3 months ago)
- Topics: go, laravel
- Language: Go
- Homepage:
- Size: 1.67 MB
- Stars: 138
- Watchers: 15
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- favorite-link - 用 go 实现 laravel。
README
# Laravel clone in go
This is an ongoing experiment to help me learn go by trying to clone the developer experience of Laravel or more accurate Lumen.
I don't know if this is actually a good idea to build applications in this manner. But maybe is a way to present go to PHP or Rails developers.
### Features
* Live update on file change (makefile sugar) + [(cespare/reflex)](https://github.com/cespare/reflex)
* Dependencies folder vendor (GOPATH to /vendor)
* Http Server [(valyala/fasthttp)](https://github.com/valyala/fasthttp)
* Routing [(qiangxue/fasthttp-routing)](https://github.com/qiangxue/fasthttp-routing)
* ORM [(jinzhu/gorm)](https://github.com/jinzhu/gorm)
* Migration (only folder like atm, looking for libraries)
* Seeding (Basic)
* Examples (User & Country CRUD)### Roadmap
* Templating (valyala/quicktemplate)
* Migration library
* More Examples
* Even More Examples
* Auth
* Config
* Commands
* Package Management [(Masterminds/glide)](https://github.com/Masterminds/glide)### Folder structure
```bash
$ tree src
.
├── app
│ ├── Helpers
│ │ └── DB.go
│ ├── Http
│ │ ├── Controllers
│ │ │ ├── CountryController.go
│ │ │ └── UserController.go
│ │ └── routes.go
│ └── Models
│ ├── Country.go
│ └── User.go
├── database
│ ├── migrations
│ │ ├── 000001_create_countries_table.go
│ │ ├── 000002_create_users_table.go
│ │ └── migrations.go
│ └── seeds
│ ├── CountriesTableSeeder.go
│ ├── UsersTableSeeder.go
│ └── seeds.go
└── main.go8 directories, 13 files
```## Docker
```bash
docker-compose up
```Server is listening on http://127.0.0.1:8080/
### Run migrations
```bash
docker-compose run api /code/bin/main migrate
```### Run seeding
```bash
docker-compose run api /code/bin/main db:seed
```Now you can see it in acion at:
http://127.0.0.1:8080/api/countries
http://127.0.0.1:8080/api/users
## Without Docker
Without docker yo need to install go and have MySQL up and running. Create a database "go_api" and root user with password "123456" or modify the file src/app/Helpers/DB.go with your MySQL credentials.
```bash
make install
make build-dev
./bin/main migrate
./bin/main db:seed
make dev #linux
make dev-mac #mac
```