- 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_ENV
environment variable. The project tries to connect to databasearora_api_development
on127.0.0.1
(seeormconfig.js
) ifNODE_ENV
is not set.
To connect to a database on an external IP, usestaging
orproduction
and setPOSTGRES_HOST
in.env
containing the address of your external database server. - Install the dependencies with
yarn install
ornpm install
. - Copy
.env.example
to.env
and update the fields to reflect your environment.POSTGRES_HOST
and the last variables starting atSENTRY_DSN
are optional, so if you don't set these, prepend them with a #. - Generate an RSA key pair and add them as files named
private.key
andpublic.key
respectively 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/configs
as desired. For example:- comment out configurations of cron jobs you don't want the server to run.
- change
1018818
in theargs
arrays 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:run
before continuing to the next steps. - To compile the TypeScript source to
.js
files, runyarn build
ornpm run build
. - To start the server, run
yarn start
ornpm start
. - The project is now accessible http://localhost:3000.