Git Product home page Git Product logo

laragol's Introduction

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

Roadmap

  • Templating (valyala/quicktemplate)
  • Migration library
  • More Examples
  • Even More Examples
  • Auth
  • Config
  • Commands
  • Package Management (Masterminds/glide)

Folder structure

$ 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

docker-compose up

Server is listening on http://127.0.0.1:8080/

Run migrations

docker-compose run api /code/bin/main migrate

Run seeding

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.

make install
make build-dev
./bin/main migrate
./bin/main db:seed
make dev #linux
make dev-mac #mac

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.