- This repo houses the api that powers review.btctranscripts.com
- The front end repo is located at github.com/bitcointranscripts/transcription-review-front-end.
- Docker
- Ensure ports 8080, 5433 and 5432 are open and accept connections (to access the backend api)
- Ensure port 3000 is open to accept connections (to access the frontend client)
- Clone the repository
-
The best way to get a database for development is to use docker
-
Navigate to the api directory
cd api -
Run
make start-depsto start the container -
optionalRunmake start-pg-shellto access the postgres shell or -
Download any database console or explorer to access the database data. We recommend dbeaver
-
To stop the running containers and server, run
make stop-deps -
Run
make reset-depsto restart all containers.
- Navigate to api directory
cd api - Create a new .env file and copy the contents of .env.example into it or run
cp .env.example .env - In api directory run
yarn installto install all dependencies - API calls are processed through a middleware. You can generate a jwt secret locally and replace
JWT_SECRETin your .env file
(e.g. const secret = require('crypto').randomBytes(64).toString('hex'))
-
Run
make initto initialize and start the api service. This will run migrations, seed the database and start the server. -
You only need run
make initthe first time. Subsequent run only requiresmake runoryarn dev
- Access the endpoints documentation here:
http://localhost:8080/api/docs
