qor-example

module
v0.0.0-...-66f8d04 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2019 License: MIT

README

QOR Example Application

This is an example application to show and explain features of QOR.

Chat Room:

Quick Start

Prerequisites
  1. If you have not already done so, install a GORM supported database — mySQL, Postgres or SQLite
  2. Install Go version 1.8 or later
  3. Configure the GOPATH environment
        $> export GOPATH=~/go
Get example app
        $> go get -u github.com/qor/qor-example
Setup the database — if using the default mysql database:

        $> mysql -uroot -p
        mysql> CREATE DATABASE qor_example;

Or, if using Postgres:


        $> psql -d postgres
        psql# create role <rolename> with login createdb;
        psql# alter role <rolename> with password '<a strong password>'
        psql Ctrl-d

        $ psql --username=<rolename> -d postgres
        psql# create database <db_name>

        $> cd ${GOPATH}/src/github.com/<account owner folder>qor-example/config/
        $> cp application.example.yml to application.yml
        $> cp database.example.yml database.yml
        $> cp smtp.example.yml smtp.yml

Edit database.yml to configure the application to connect to the database


        $> vim database.yml
        :i edit as below
            db:
                name: <db_name>
                adapter: postgres
                host: localhost
                port: 5432
                user: <rolename>
                password: <a strong password>
        :wq

        $>  

TODO: Integrate with Hashicorp Vault for management of user credentials

Run Application

        $> cd $GOPATH/src/github.com/qor/qor-example
        $> go run main.go # The server listens on port 7000
        $> Ctrl-C # to interupt

Alternatively, to start the port on an alternate port

        $> cd $GOPATH/src/github.com/qor/qor-example
        $> (export PORT=<NNNN> && go run main.go) # Listens on port NNNN
        $> Ctrl-C # to interupt
Generate some sample data
        $> go get github.com/azumads/faker
        $> cd $GOPATH/src/github.com/qor/qor-example
        $> go run config/db/seeds/main.go config/db/seeds/seeds.go

TODO: Investigate the warnings about GORM and migrations and the warnings about the FullWidthBannerEditor

Run tests (Pending)

        $> go test $(go list ./... | grep -v /vendor/ | grep  -v /db/)

Admin Management Interface

Qor Example admin configuration

Online Demo Website: demo.getqor.com/admin

RESTful API

Qor Example API configuration

Online Example APIs:

License

Released under the MIT License.

@QORSDK

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL