- Node.js (with NPM)
- Yarn (alternative to NPM, not required)
- A running PostgreSQL server
- Create a Postgres user with permission to create databases.
- Create a new database as your just created Postgres user, named
arora_api_<env>with<env>being yourNODE_ENVenvironment variable. The project tries to connect to databasearora_api_developmenton127.0.0.1(seeormconfig.js) ifNODE_ENVis not set.
To connect to a database on an external IP, usestagingorproductionand setPOSTGRES_HOSTin.envcontaining the address of your external database server. - Install the dependencies with
yarn installornpm install. - Copy
.env.exampleto.envand update the fields to reflect your environment.POSTGRES_HOSTand the last variables starting atSENTRY_DSNare optional, so if you don't set these, prepend them with a #. - Generate an RSA key pair and add them as files named
private.keyandpublic.keyrespectively to the root of this project. - Generate a JSON Web Token using the just generated RSA key pair. You can enter the public and
private keys underneath "VERIFY SIGNATURE". What you enter underneath "PAYLOAD" doesn't matter since that's not
being used in this project at the moment. Make sure to set the algorithm to
RS256.
Save this JWT somewhere as it's used for authenticating incoming requests. - Configure the configurations in
src/configsas desired. For example:- comment out configurations of cron jobs you don't want the server to run.
- change
1018818in theargsarrays to your own group's ID to have the jobs run for your group instead.
- If you're starting the project for the first time, or if a new database migration has been added (in
src/migrations), you need to runtypeorm migration:runbefore continuing to the next steps. - To compile the TypeScript source to
.jsfiles, runyarn buildornpm run build. - To start the server, run
yarn startornpm start. - The project is now accessible http://localhost:3000.
