top
(README.md)
# Playcheck

Main repository for the Go web API and frontend applications for Playcheck.

## 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 bitbucket.org/ab2_2/playcheck
```

### Defining environment variables

A few environment variables must be set in order to run the application correctly.
The required env variables are:

- SMTP_HOST
- SMTP_PASS
- SMTP_PORT
- SMTP_USER
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- FACEBOOK_CLIENT_ID
- FACEBOOK_CLIENT_SECRET

These variables can be copied from the heroku config variables.

### 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

### Compiling and Running

To compile and run the project:

```shell
go build -o playcheck.o && ./playcheck.o
```

Imports 9 package(s) ΒΆ

  1. github.com/lib/pq
  2. bitbucket.org/ab2_2/playcheck/routes
  3. bitbucket.org/ab2_2/playcheck/config
  4. github.com/gorilla/sessions
  5. bitbucket.org/ab2_2/playcheck/services/cart
  6. github.com/jinzhu/gorm
  7. bitbucket.org/ab2_2/playcheck/handlers
  8. bitbucket.org/ab2_2/playcheck/handlers/httputils
  9. github.com/gorilla/mux