Skip to content

drehauf/api

Repository files navigation

api

Description

Dreh Auf CMS GraphQL endpoint.

Table Of Contents

Installation

$ npm install

Running The App

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Development Secrets

We use dotenv to keep secrets.

⚠️ The .env file containing the secrets is included in .gitignore and will not be tracked

You need to add the file to root and the following secrets yourself:

  • TYPEORM_CONNECTION: type of database to use
  • TYPEORM_HOST: database host adress
  • TYPEORM_PORT: database port
  • TYPEORM_USERNAME: username with database access rights
  • TYPEORM_PASSWORD: password for username
  • TYPEORM_DATABASE: database name
  • TYPEORM_SYNCHRONIZE: enable synchronization of entites every time the app is run
  • TYPEORM_LOGGING: enable logging
  • TYPEORM_ENTITIES: the entity file locations

Testing

# unit tests
$ npm run test

# unit tests on watch mode
$ npm run test:watch

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Data Model

Show file preview data model screenshot

The entity-relationship model is encoded in the file erm.drawio. To view and edit it, follow these steps:

  1. Go to DrawIO and log in with Github
  2. Click FileOpen fromGitHub...
  3. Choose drehauf/apierm.drawio