Skip to content

ab22/abcd

Repository files navigation

A.B.C.D.

Join the chat at https://gitter.im/ab22/abcd

Main repository for the Go web API and frontend applications for A.B.C.D.

Login

Configuration

Before running the project, it is necessary to have a Go workspace and the $GOPATH environment variable. Read How to Write Go Code to configure the project correctly.

Downloading the project

go get -u github.com/ab22/abcd

Database Migrations

It is required to have installed Postgres on the local computer. All migration files are saved in the migrations folder. To automatically run these queries, it is recommended to use the migrate tool.

go get -u github.com/mattes/migrate

Console syntax to migrate all queries:

cd github.com/ab22/abcd/
migrate -url postgres://user:pass@host:port/dbname?sslmode=disable -path ./migrations up

Note: It is required to have MinGW32/64bit installed on Windows!

Running the application

Installation

It is required to have glide installed to download the required packages for the project. To install glide and download the packages with glide run:

go get -u github.com/Masterminds/glide
glide install

A new vendor/ folder should have been created with all the required dependencies.

Compiling and Running

To compile and run the project:

go build -o abcd.o && ./abcd.o

Testing the Backend

Since using 'go test ./...' will take the vendor folder as a valid package path, it will attempt to test all of the vendored packages. Also, since this project contains a frontend folder with all of it's frontend npm/bower modules, 'go test ./...' will also scan those folders taking up more time for the test run to complete.

To avoid all previously mentioned, use the test.sh script to tests current golang packages.

./test.sh

TODO

Frontend

☑ Setup a package.json file.

☑ Configure bower and a bower.json file with the dependencies.

☑ Create and configure the jshint files and js code styles (jscsrc).

☑ Setup grunt and it's tasks.

☐ Setup the test frameworks.

☐ Create tests for the application.

Backend

☑ Configure the backend file for dependencies to run the project.

☑ Setup the db models and services module.

☑ Setup the Godep folder for dependencies.

☑ Configuration variables for databases.

☑ Configure a database migrator. Currently, we are using the GORM migrations but it would be better to have sql scripts to migrate and create the data.

☐ Create tests for the application.

Others

☑ Setup a Heroku site to host the application.