Offical backend of CougarCS.
-
- Install dependencies:
yarn
- Start local server:
yarn server
- The local server will start on http://localhost:4000
- Install dependencies:
-
- If you want to test out the payment or the reCAPTCHA, create a
.env
file in the root project folder. - You must have a Stripe, Google's reCAPTCHA, and SendGrid accounts.
- In the
.env
file include these:
SENDGRID_API_KEY CALENDAR_ID CALENDAR_API_KEY SHEET_API RECAPTCHA_SECRET_KEY STRIPE_API_KEY SENTRY_URL SEND_EMAIL INGESTION_KEY NOTION_TOKEN NOTION_TUTOR_DB COUGARCS_CLOUD_URL COUGARCS_CLOUD_ACCESS_KEY COUGARCS_CLOUD_SECRET_KEY
- Reach out to the Webmaster(webmaster@cougarcs.com) for the env values
- If you want to test out the payment or the reCAPTCHA, create a
-
- We use ESLint to fix styling and to enforce rules.
- Run
yarn run eslint-check
to check linting issues in the code. - Run
yarn run eslint-fix
to auto-lint the code. - ESLint runs on Github Action. ESLint must pass before pushing or during a pull request.
-
- We use Jest to do Unit testing.
- We use Supertest to do intergeration test.
- To run the tests locally:
- Run
yarn test
- Run
- To test the coverage of the code:
- Run
yarn test:coverage
- Run
- The tests are part of the CI/CD pipeline, if the test fails the CI/CD fails
- The test coverage has to be 90% or greater and the coverage cannot drop below 5% for a PR or a push.
- We use Coveralls to track the coverage.
-
server.js
is the starting point of the applicationsrc/api/routes/
has the routes of the applicationssrc/config/app.js
sets up the middlewaressrc/utils/api/calls.js
has the api logicsrc/utils/
has config for logger and Prometheustest
has the unit and the intergeration test