You have 2 options. Install required tools locally or use docker (with docker-compose in this case).
This app relies on redis for caching. It also connects to dynamodb when running locally. These should both be stubbed out for local development but not gotten there yet.
Install Redis and make sure it's running.
To run the app yarn dev
This compiles the typescript in the app and runs it.
This will launch the application on localhost:8080
This project has a dockerfile and a docker-compose file.
If you have installed docker, then you should have the docker-compose
command.
You will first need to build the docker image using docker-compose build
(from the root of the project directory)
Then run docker-compose up
to run the project.
It will also be available at localhost:8080
If you add any new dependencies, you will need to run docker-compose build
again.
This app picks up all its configurations from environment variables. We haven't implemented a nice way of dealing with this for local development yet so in the meantime, make sure you have configured values for all of these:
SPOTIFY_CLIENT_ID SPOTIFY_CLIENT_SECRET PUSHER_APP_ID PUSHER_KEY PUSHER_SECRET PUSHER_CLUSTER DYNAMO_DB_USER_ID DYNAMO_DB_SECRET_KEY DYNAMO_DB_REGION LOGGLY_SUB_DOMAIN LOGGLY_TOKEN ROLLBAR_ACCESS_TOKEN FACEBOOK_APP_ID
Deployments are automated. We use CodeShip to automate deployments. All you need to do is push changes to the master branch to deploy. Other branches will not deploy.
See the build badge at the top of this Readme for more.
Once deployed the app is available at https://api.musicmonkey.io
If you get an annoying Dtrace error running the app on a Mac, this helped:
In my case that was:
xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Followed by:
yarn global add node-gyp
rm -rf node_modules yarn.lock
yarn install
in .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/build/server/server.js"
}
]
}