top
(README.md)
# A.B.C.D.

[![Join the chat at https://gitter.im/ab22/abcd](https://badges.gitter.im/ab22/abcd.svg)](https://gitter.im/ab22/abcd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

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

![Login](http://i.imgur.com/esdXYyA.png)

## Configuration

Before running the project, it is necessary to have a Go workspace and the
$GOPATH environment variable. Read [How to Write Go Code](https://golang.org/doc/code.html)
to configure the project correctly.

### Downloading the project

```shell
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](https://github.com/mattes/migrate) tool.

```shell
go get -u github.com/mattes/migrate
```

Console syntax to migrate all queries:

```shell
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: 
```shell
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:

```shell
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.

```shell
./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.

Imports 9 package(s)

  1. github.com/ab22/abcd/httputils
  2. github.com/ab22/abcd/handlers
  3. github.com/ab22/abcd/config
  4. golang.org/x/net/context
  5. github.com/ab22/abcd/routes
  6. github.com/gorilla/sessions
  7. github.com/gorilla/mux
  8. github.com/lib/pq
  9. github.com/jinzhu/gorm