Skip to content

Latest commit

 

History

History
104 lines (73 loc) · 2.38 KB

README.md

File metadata and controls

104 lines (73 loc) · 2.38 KB

CourtHive Logo

CourtHive is an Open Source / Open Data initiative to develop components to support the emergence of a standards based ecosystem of services for competition.

NPM Version Package License NPM Downloads

Description

Lightweight NestJS example server for testing client/server use cases with tods-competition-factory

Installation

$ pnpm install

.env file

Create an .env file in the root directory.

APP_STORAGE='fileSystem' # 'levelDB' or 'fileSystem'
APP_NAME='Competition Factory Server'
APP_MODE='development' # 'production'
APP_PORT=8383

JWT_SECRET='Replace this string with a truly random string'
JWT_VALIDITY=2h

TRACKER_CACHE='cache'

REDIS_TTL= 8 * 60 * 60 * 1000
REDIS_HOST='localhost'
REDIS_USERNAME=''
REDIS_PASSWORD=''
REDIS_PORT=6379

DB_HOST=localhost
DB_PORT=3838
DB_USER=admin
DB_PASS=adminpass

MAILGUN_API_KEY='your-mailgun-api-key'
MAILGUN_HOST='api.eu.mailgun.net'
MAILGUN_DOMAIN='m.your.domain'

Storage

By default the server will store tournaments in the file system. In order to use levelDB to persist tournament records, net-level-server must be running.

$ pnpm hive-db

Running the app

If you have PM2 installed:

pm2 start ecosystem.config.js

...otherwise...

# development
$ pnpm start

# watch mode
$ pnpm watch

# production mode
$ pnpm start:prod

Test

# unit tests
$ pnpm test controller
$ pnpm test factory
$ pnpm test service

# e2e tests
$ pnpm test e2e

# test coverage
$ pnpm run test:cov

Support

License

The Competition Factory is MIT licensed.