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.
- Live update on file change (makefile sugar) + (cespare/reflex)
- Dependencies folder vendor (GOPATH to /vendor)
- Http Server (valyala/fasthttp)
- Routing (qiangxue/fasthttp-routing)
- ORM (jinzhu/gorm)
- Migration (only folder like atm, looking for libraries)
- Seeding (Basic)
- Examples (User & Country CRUD)
- Templating (valyala/quicktemplate)
- Migration library
- More Examples
- Even More Examples
- Auth
- Config
- Commands
- Package Management (Masterminds/glide)
$ 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.go
8 directories, 13 files
docker-compose up
Server is listening on http://127.0.0.1:8080/
docker-compose run api /code/bin/main migrate
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 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.
make install
make build-dev
./bin/main migrate
./bin/main db:seed
make dev #linux
make dev-mac #mac