CI

Welcome to the backend nüli test app

For full instructions on what we'd like you to do please visit our official developer test page

Deliverables

  • API
    • Endpoints
      • Fetch a workout
        • Basic info
        • Workout content: warmup w/ circuits, main workout w/ circuits, exercises
      • Swap an exercise of a workout
      • Authentication
    • E2E test
    • Documentation with sample request/response
    • Unit test
  • Misc
    • Assets serving

Backlog

  • API
    • Endpoints
      • Fetch a workout
        • Workout content: warmup w/ circuits, main workout w/ circuits, exercises
      • Swap an exercise of a workout
      • Authentication
    • Unit test
  • Feature
    • Template-rize workout for individual users to clone
    • Exercise swapping
  • DB
    • Leverage STI for warmup and workout group records
    • Normalization
    • Inspect queries via query plans and optimize when seen fit
  • Misc
    • Assets serving

Documentation & Sample Request/Response

Use Postman's import feature to import /docs/api/postman_collection.json for API documentation.

Installation

$ npm install

Running the app

$ cp .env.example .env
# then update DATABASE_URL inside .env to an actual PostgreSQL endpoint

$ npm run db:migrate:dev

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

# access graphQL playground via http://localhost:3000/graphql

Test

$ cp .env.test.example .env.test.local
# then update DATABASE_URL inside .env.test.local to an actual PostgreSQL endpoint

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov