shubhsheth / CougarCS-Backend

CougarCS Website

Home Page:https://cougarcs-backend.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CougarCS Backend

Offical backend of CougarCS.



Known Vulnerabilities Coverage

Libraries

Getting Started

  • Requirements

    • NodeJS version 12+
    • We use Yarn as our package manager
  • Installation

    • Install dependencies: yarn
    • Start local server: yarn server
    • The local server will start on http://localhost:4000
  • ENV Setup:

    • 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
    
  • Linting

    • 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.
  • Testing

    • We use Jest to do Unit testing.
    • We use Supertest to do intergeration test.
    • To run the tests locally:
      • Run yarn test
    • To test the coverage of the code:
      • Run yarn test:coverage
    • 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.
  • Project Structure

    • server.js is the starting point of the application
    • src/api/routes/ has the routes of the applications
    • src/config/app.js sets up the middlewares
    • src/utils/api/calls.js has the api logic
    • src/utils/ has config for logger and Prometheus
    • test has the unit and the intergeration test

About

CougarCS Website

https://cougarcs-backend.herokuapp.com/


Languages

Language:JavaScript 99.1%Language:Dockerfile 0.9%