A UI for manually providing data for courtbot.
- Create a Postgres database
- Copy
.env.example
to.env
then change the example settings to your own.DATABASE_URL
setting is your Postgres connection URL which will be in this format: DATABASE_URL='postgres://USERNAME:PASSWORD@HOST:PORT/DATABASE'DATABASE_DIALECT
should be 'postgres'.
- Run app with
npm run dev
By default, authentication is bypassed when developing locally. This is controlled by the environment variable BYPASS_AUTH
. When this flag is not true
, you will need to configure Auth0 and all of the AUTH0 environment variables.
Database migrations are handled on application startup by db-migrate.
- Follow the instructions below for configuring Auth0
- Create, configure, and push your Heroku app with the following:
heroku create
heroku addons:add heroku-postgresql
# See .env.sample for all possible env variables
heroku config:set ENV_VARIABLE=<value>
git push heroku master
OAuth2 authentication is provided by Auth0 so these steps will get you going there:
- Register for an account with Auth0
- Create a new connection database for Courtbook
- Name it "courtbook-user-database"
- Disable sign ups - this prevents self-signup
- Create the "Courtbook UI" client - The client is used by the Courtbook UI for user authentication
- Click on "Clients" then the "Create Client" button.
- Fill in the client name as "Courtbook UI"
- Choose the "Single Page Web Applications" then click "Create"
- Under settings:
- Allowed origins (CORS):
- Add
https://<your_sub_domain>.herokuapp.com
- Local development only add
http://localhost:5000
- Allowed callback URLs:
- Add
https://<your_sub_domain>.herokuapp.com/login
- Local development only add
http://localhost:5000/login
- Local development only add
- Create the "Courtbot" client - This client is used for courtbot to make calls to certain API endpoints without providing a username and password
- Click on "Clients" then the "Create Clients" button
- Fill in the client name as "Courtbot"
- Select "Non Interactive Clients" then click "Create"
- Create the "Courtbook API"
- Click on "APIs" then the Create API button and create the API with the following:
- Name: "Courtbook API"
- Identifier: "https://tulsa-courtbook.herokuapp.com"
- Signing Algorithm: "RS256"
- Authorize the "Courtbook API" editing the API and clicking "Non Interactive Clients"
- Click on "APIs" then the Create API button and create the API with the following: