e6e is a forecasting tool for small groups. Currently Alpha, run at your own risk.
This is a Revel web application with a DynamoDB backend, requiring Google developer credentials.
See the docs
folder for:
data-structures.md
- API Blueprint MSON schema (this will be expanded as benefits demand)domain-model-overview.svg
- basic, high-level entity relationships (needs to evolve with the domain model in code)wireframes.pdf
- simple export from moqups.com project (which has additional commentary on the codebase outside of the PDF's page canvas)
The features
folder contains BDD feature files that still need to be fleshed out and automated, but at least provides high-level feature specs/expectations.
Dependencies before getting started:
- Setup Go & Dep
- Clone the github repo
- Setup Revel
- Verify the install works
- Setup AWS credentials
- Setup DynamoDB
- Setup Google Identity
Currently developing with go1.11.1
. Golang is picky on having a structured $GOPATH
.
Clone this repo into: ($GOPATH/src/github.com/magoo/www-forecast
)
Install the dep package manager for go, brew install dep and ensure dep.
This is replaced with go modules (or trying to be, in this branch.)
You'll need the revel command line tool.
go get -u github.com/revel/cmd/revel
Enter the $GOPATH/src/www-forecast
directory and (revel -X-v run
). The server should start locally. It won't work quite yet as we haven't setup AWS and Google credentials, but this is a good point to stop and troubleshoot any issues with Go or Revel.
Required: Use go run scripts/generatesecret.go
, store the value in the environment as E6E_SESSION_SECRET
. This is used for signed cookies.
Create an IAM programmatic user account with permission to modify DynamoDB.
Once you have these, make sure they are loaded in your path:
export AWS_SECRET_KEY= (AWS secret key)
export AWS_ACCESS_KEY= (AWS access Key)
Install terraform. The tf
folder contains a terraform configuration to create the DynamoDB tables needed to operate.
terraform apply
within the tf/
directory to set up tables.
You can use the
E6E_TABLE_PREFIX
environment variable to point the app at a specific set of tables, but you'll have to modify the terraform script to name these tables with your chosen prefix.
You'll need a set of Google API/OAuth credentials to work with http://localhost:9000
or whatever domain you'll be using.
Once you have these, make sure they are loaded in your path:
export E6E_GOOGLE_CLIENT= (Google Client)
export E6E_GOOGLE_SECRET= (Google Secret)
This is currently a docker container (Dockerfile
included) that is pushed to Fargate (An AWS service). The Fargate configuration is manual and not yet documented. Currently, roles and environment are configured in production.
./build
docker build -t scrty .
docker tag scrty:latest 832911230879.dkr.ecr.us-east-1.amazonaws.com/scrty:latest
aws --profile magoo ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 832911230879.dkr.ecr.us-east-1.amazonaws.com
docker push 832911230879.dkr.ecr.us-east-1.amazonaws.com/scrty:latest
aws --profile magoo ecs update-service --region us-east-1 --force-new-deployment --service e6e-service-prod --cluster e6e-cluster-prod
There are a number of environment variables that can change how the application functions.
Your specific AWS region.
To specify a custom revel config you can add a comma separated list of directories containing app.conf files that revel will check. For more info see https://revel.github.io/manual/appconf.html#external_app.conf
To override the default dynamodb table name for use in custom deployments use this variable. The default is questions-tf
To override the default dynamodb table name for use in custom deployments use this variable. The default is answers-tf
This is the Oauth client id for logging into the application with Google.
This is the Oauth client secret for logging into the application with Google.