This is the echo service.
Welcome to Echo.
Before you can run echo you need:
- To install and set up the IDM service
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
npm install -g avn avn-nvm
avn setup
3. Setup and run mehserve.
Figure out which port you intend to use and create the mehserve config file:
echo 9005 > ~/.mehserve/echo.learnersguild
export NODE_ENV=development
Make a copy of your access key ID and secret access key. You'll need to include these in your environment variables in the next step.
Take out all comments in your final version. Example:
PORT=9005
APP_BASE_URL=http://echo.learnersguild.meh
APP_PROJECT_URL=http://echo.learnersguild.meh/projects
REDIS_URL=redis://localhost:6379
RETHINKDB_URL=rethinkdb://localhost:28015/echo_development
# IDM / JWT settings, including session extension
IDM_BASE_URL=http://idm.learnersguild.meh
JWT_PRIVATE_KEY="<get from IDM service>"
JWT_PUBLIC_KEY="<get from IDM service>"
# External API settings
GITHUB_CRAFTS_REPO="https://github.com/GuildCraftsTesting/web-development-js-testing"
S3_BUCKET=guild-development
S3_KEY_PREFIX=db
AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY_ID>
AWS_SECRET_ACCESS_KEY=<YOUR_AWS_SECRET_ACCESS_KEY>
npm install
npm run db:create
NODE_ENV=test npm run db:create
npm run db:migrate:up
NODE_ENV=test npm run db:migrate:up
Optionally, seed your development database with test member and project data:
npm run db:copy -- <STATE>
Available STATE
options:
PRACTICE
REFLECTION
NOTE: you'll need rethinkdb, 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.meh
Start the workers NOTE: you'll need to start redis for the workers to run correctly.
npm run workers
npm run workers:cycleLaunched
Add the following to your .env.development
:
# Slack / command CLI settings
CHAT_BASE_URL=https://slack.com
CHAT_API_TOKEN=<the Slack bot user's OAuth access token. obtain from a teammate or in the Slack team's app settings>
Add the following to your .env.development
:
CLI_COMMAND_TOKEN=<the Slack app's verification token. obtain from a teammate or in the Slack team's app settings>
npm install -g localtunnel
npm run slackslash
NOTE: You can ignore this message after starting localtunnel:
your url is: https://slackslash.localtunnel.me
It's not a URL you're meant to visit in the browser directly; it is the URL already configured in the dev Slack team's echo app and where incoming requests for /slash commands are sent. With localtunnel running and configured properly (along with echo
, idm
and mehserve
), when you issue a slash command in a channel in the dev Slack team, the request will be sent to https://slackslash.localtunnel.me and served by the echo service running on your local machine.
We use Codeship for continuous integration. The following files are responsible for CI configuration:
Dockerfile
: basic Docker image for the appcodeship-services.yml
: similar todocker-compose.yml
, but for CIcodeship-steps.yml
: the steps to run on each service for CIapp.env.encrypted
: encrypted environment vars for the app (e.g.,NPM_AUTH_TOKEN
)
See the LICENSE file.