Backend API service for NTUCourse-Neo.
-
Clone the repository
git clone https://github.com/NTUCourse-Neo/ncn-backend.git cd ncn-backend
-
Prepare your
.env
fileRun command below to create a
.env
filecp .env.defaults .env
Then paste your keys into the file. Please refer to the table below.
Reminder: Make sure you follow the environment variable file format of Docker.KEY Description Default Value MONGO_URL MongoDB connection string N/A PORT Server running port 5000 OTP_EXPIRE_MINUTES Linking One Time Password (OTP) expire minutes 5 ENV Running environment dev AUTH0_DOMAIN Auth0 Account Domain N/A AUTH0_CLIENT_ID Auth0 API Service Client ID N/A AUTH0_CLIENT_SECRET Auth0 API Service Client Secret N/A AUTH0_API_AUDIENCE Auth0 Management API Identifier N/A SELF_API_AUDIENCE NTUCourse-Neo API Identifier N/A SENDGRID_FROM_EMAIL Sendgrid Sender E-Mail Address N/A SENDGRID_API_KEY Sendgrid API Key N/A SENDGRID_OTP_TMPL_ID Sendgrid E-Mail Template ID for OTP N/A RECAPTCHA_SECRET reCAPTCHA Service Client Secret N/A DISCORD_WEBHOOK_URL Discord Webhook URL N/A -
Install Docker on your device.
Please refer to this guide.
-
Build docker image
docker build -f Dockerfile -t ncn-backend .
-
Run the built image in container
docker run --env-file .env -p 5000:5000 ncn-backend
-
Open the browser and go to http://localhost:5000/api/v1/healthcheck
and you should see the 200 OK response.
-
Have fun! ๐
-
Clone the repository
git clone https://github.com/NTUCourse-Neo/ncn-backend.git cd ncn-backend
-
Prepare your
.env
fileRun command below to create a
.env
filecp .env.defaults .env
Then paste your keys into the file. Please refer to the table below.
KEY Description Default Value MONGO_URL MongoDB connection string N/A PORT Server running port 5000 OTP_EXPIRE_MINUTES Linking One Time Password (OTP) expire minutes 5 ENV Running environment dev AUTH0_DOMAIN Auth0 Account Domain N/A AUTH0_CLIENT_ID Auth0 API Service Client ID N/A AUTH0_CLIENT_SECRET Auth0 API Service Client Secret N/A AUTH0_API_AUDIENCE Auth0 Management API Identifier N/A SELF_API_AUDIENCE NTUCourse-Neo API Identifier N/A SENDGRID_FROM_EMAIL Sendgrid Sender E-Mail Address N/A SENDGRID_API_KEY Sendgrid API Key N/A SENDGRID_OTP_TMPL_ID Sendgrid E-Mail Template ID for OTP N/A RECAPTCHA_SECRET reCAPTCHA Service Client Secret N/A DISCORD_WEBHOOK_URL Discord Webhook URL N/A -
Install required dependencies
yarn
-
Run the server
yarn server
-
Open the browser and go to http://localhost:5000/api/v1/healthcheck
and you should see the 200 OK response.
-
Have fun! ๐
- babel
- nodemon
- express
- axios
- cors
- dotenv-defaults
- express-jwt
- express-oauth2-jwt-bearer
- jwks-rsa
- mongoose
- mongodb
- @sendgrid/mail