• Stars
    star
    148
  • Rank 249,983 (Top 5 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Goyangi is a web foundation to help you getting started with a new web project based on Golang.

Goyangi

Goyangi means cat in Korean.

The goal

The goal of Goyangi project is making a reliable foundation for developers who want to make web services with the Go server. When the Goyangi project becomes more stable, developers would become lazybones. Consequently, lazybones could not only show their creativity but also devote themselves to problems what they can solve. It is also a good example of how to develop a large web application that combined fancy Go packages.

Why?

There are some good frameworks like magic(Beego, Revel...). However, these are too much. Some developers prefer to using micro frameworks and lightweight packages for flexibility and performance. It's not easy to select and combine packages though. So, Goyangi carefully has chosen packages and combined. Keep it simple and DRY.

How it works?

Goyangi How it works

Getting Started

Pre installation

  • dep - Install the dependency management for Go.
  • PostgreSQL - Install and run the postgresql service. [username: postgres / password: postgres]
  • yarn - Install a dependency management tool.

Clone the source

$ git clone github.com/dorajistyle/goyangi
$ cd goyangi
$ dep ensure

Run server

SOURCE_ROOT $ go run main.go

Migration (First time only)

createdb goyangi_dev -U postgres;
createdb goyangi_test  -U postgres;
createdb goyangi  -U postgres;

Connect to http://localhost:3001/api/v1/commands/migrate while running the server.

Run frontend (Vue.js)

SOURCE_ROOT $ cd frontend/vuejs
VUE_JS_ROOT $ yarn
VUE_JS_ROOT $ yarn serve

Default Login for Goyangi

  • ID : admin
  • password : password

Goyangi Vue.js Home

Goyangi Vue.js Board

Configuration

Backend

You can find all configuration files in ./config

  • api.go : API related configuration.
  • authentication.go : Authentication related configuration.
  • aws.go : If you want to use aws S3, you should setup configuration here.
  • db.go : Be sure that you have a database for migration and run application.
  • email.go : If you want to send an email to users, set your email information.
  • environment.go : It has three types of environments. DEVELOPMENT | TEST | PRODUCTION
  • image.go : Image related configuration.
  • logger.go : Log related configuration.
  • oauth.go : When you want to connect with oauth, set your oauth information.
  • order.go : Ordering of models.
  • pagination.go : Pagination of models.
  • public.go : Public fields of user for privacy.
  • uploader.go : Uploader related configuration.

Features

  • Restful support
  • From Development to Deployment
  • SPA ready

Restful API

User

User is core of web application.

  • User CRUD
  • User Authentication
  • Oauth
  • User role for admin
  • Permissions handling to access each API
  • Email verification
  • Password reset via email
  • Following
  • Activation
  • MD5 for Gravatar
  • Messaging

Article

It is a foundation of a basic content management system(CMS).

  • Article CRUD
  • Liking
  • Comment

Upload

It is a foundation of basic file upload.

  • Upload files to local storage
  • Upload files to amazon aws S3
  • Upload files metadata to database
  • Upload files to other cloud servers
  • Upload csv to database
Image

Image handling included in uploads function.

  • Resize (vips)
  • Filtering (gift)
App management for permissions

It would be a foundation of App management for permissions such as API call permission.

  • [] -

Other API

We can add any foundation API we need.

  • We can add any foundation code that is commonly used in web application.

From Development to Deployment

Testing

  • BDD testing
   $ go run main.go test

Deployment

Install swagger
  go get github.com/yvasiyarov/swagger
Install Asciidoctor
   sudo gem update --system
sudo gem install -n /usr/local/bin asciidoctor -N
   go run goyangi.go generateAPI

SPA ready

Goyangi separates server and frontend clearly. And default SPA frontend used Vue.js. However, developers can add frontend easily. Are you interested? Develop frontend and put it into 'frontend/' directory.

Frontend Implemantation

API Server Vuejs
User all registration,login,logout
Article all all
Upload all -
Image all -

Packages

Goyangi uses great open source packages. You can check that which packages used in Goyangi web foundation.

Go Packages

Frontend Packages

TODO

  • Decide what functions should be maintained.
  • Implement All server features in Vue.js frontend.
  • Add tons of BDD tests
  • Improve documentation
  • Automatically ignore private configuration when commit using git filter for contributors.

Contribution

Any contributions are more than welcome.

Donation

tips flattr bitcoin


Attributions

Goyangi is under the MIT license