Authentication and user service for ripple.fm
Acts as an OAuth2 provider for the ripple.fm web client and exposes REST API endpoints for user data.
- yarn or npm
- Typescript
- docker and docker-compose
This project was built with:
- Typescript
- express + routing-controllers for controllers
- oauth2orize
- TypeORM
- webpack for bundling/transpiling sass and es6
- pug for templating html and MJML for templating emails
This project uses Prettier for formatting. It's recommended to configure your editor to work with prettier using the editor integrations.
Formatting is checked when Travis CI runs a build and can be checked locally using the one of the following commands:
yarn lint
or
npm run lint
We must first set the environment variables defined in .env.example. The variables include comments and are marked optional. NOTE: Some variables are not required to run the basic development environment.
The steps for defining your environment variables:
- Copy
.env.exmaple
to.env
- Update values for the variables
- Source the environment using
source .env
Now that we loaded the environment variables we can start the service using docker-compose
To start we run:
$ docker-compose up
To stop:
$ docker-compose down
Travis CI will automatically build and push tagged commits (matching the version in package.json
) to the docker image repository.
After an image is built and pushed, update the helm chart for ripple.fm to set the updated tag for the auth service.
Some notes about deploying to production:
- Ensure
NODE_ENV
is set toproduction
- the
REDIS_PASSOWRD
environment variable is optional but recommended
The auth service includes cli commands defined here. These commands can be used to initialize our service (i.e running migrations or creating oauth2 clients).