Skip to content

ian-deans/echo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

echo (formerly game)

Codeship Status for LearnersGuild/echo Code Climate GPA Code Climate Issue Count Test Coverage

This is the echo service.

GETTING STARTED

Welcome to Echo.

Before you can run echo you need:

  • To install and set up the IDM service
  • To install and set up the LG bin
  • For live data: an invitation the LG Team on Heroku

SET UP ECHO

1. Globally install nvm, avn, and avn-nvm.
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
npm install -g avn avn-nvm
avn setup
2. Fork and clone the repository.
3. Setup and run mehserve.

Figure out which port you intend to use and create the mehserve config file:

echo 9005 > ~/.mehserve/echo.learnersguild
4. Set your NODE_ENV environment variable:
export NODE_ENV=development
6. Create your .env.development file for your environment.

Take out all comments in your final version. Example:

PORT=9005
APP_BASE_URL=http://echo.learnersguild.dev
REDIS_URL=redis://localhost:6379
RETHINKDB_URL=rethinkdb://localhost:28015/echo_development
# IDM / JWT settings, including session extension
IDM_BASE_URL=http://idm.learnersguild.dev
JWT_PRIVATE_KEY="<get from IDM service>"
JWT_PUBLIC_KEY="<get from IDM service>"
# Slack / command CLI settings
CHAT_BASE_URL=https://slack.com
CHAT_API_TOKEN=<get from dev slack instance>
CLI_COMMAND_TOKEN=<get from echo slash commands app>
# external API settings
GITHUB_ORG_ADMIN_TOKEN="<GitHub token with permissions in LearnersGuild, GuildCrafts, and GuildCraftsTesting>"
GITHUB_CRAFTS_REPO="https://github.com/GuildCraftsTesting/web-development-js-testing"
HEROKU_API_TOKEN="<Heroku API token with permissions on all of our apps>"
7. Install dependencies:
npm install
8. Create a development & test databases:
npm run db:create
NODE_ENV=test npm run db:create
npm run db:migrate:up
NODE_ENV=test npm run db:migrate:up

SYNC PRODUCTION DATABASES (Optional)

If you need to sync prod databases to your local setups: You'll need to be invited to the LG Team on Heroku for this to work. install heroku locally and use the heroku cli to log in locally. Run the heroku access command to confirm that you have access:

heroku access -a lg-echo

Use the Resync command to sync the live echo and idm data to your local environment. You must have LG bin cloned and running for this to work.

To ensure the bin environments are ready for syncing with the database:

ls -l /usr/local/bin/rethinkdb-export

If you don't have /usr/local/bin/rethinkdb-export you'll need to install pip and then use it to install the python rethinkdb drivers

brew install pip
sudo pip install rethinkdb

WARNING You have access to the production systems and data now. Please be careful. You now have the power to cause a lot of damage.

In your bin folder:

./resyncdb lg-echo echo_development
./resyncdb lg-idm idm_development

RUN THE SERVER

NOTE: you'll need mehserve, idm and this server all running at the same time for things to work.

npm start

Visit the server in your browser:

open http://echo.learnersguild.dev

Start the workers

npm run workers
npm run workers:cycleLaunched

NOTE: If you want to use /slash commands from the development Slack instance, you'll need to set up localtunnel, as well:

npm install -g localtunnel
lt --port $(cat ~/.mehserve/echo.learnersguild) --subdomain slackslash

CONTINUOUS INTEGRATION

We use Codeship for continuous integration. The following files are responsible for CI configuration:

  • Dockerfile: basic Docker image for the app
  • codeship-services.yml: similar to docker-compose.yml, but for CI
  • codeship-steps.yml: the steps to run on each service for CI
  • app.env.encrypted: encrypted environment vars for the app (e.g., NPM_AUTH_TOKEN)
  • herokudeployment.env.encrypted: encrypted environment vars for Heroku deployment (e.g., HEROKU_API_KEY)

LICENSE

See the LICENSE file.

About

echo: learning management system

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.5%
  • CSS 1.5%