API base url: epi-use-assessment-server.herokuapp.com
Server source for EPI-USE technical assessment project. The server-side code provides most core functionality of the system and a persistence layer. It provides a RESTful API endpoint to the client-side application.
Useful information regarding the use of endpoints can be found in the documentation link provided above.
This repository is configured to automatically deploy to Heroku, run unit tests and deploy documentation to Github pages.
This server is built using the Nest.js framework. It is highly modular and configurable. Because the client-side application uses Angular (TypeScript), the choice of a TypeScript-based server framework which follows a very similar MVC pattern to Angular helps reduce time shifting paradigms between working on the client and server code bases.
TypeORM has been used as an object-relational mapper for this project. It provides a simple yet advanced interface between TypeScript objects and many database providers (this project uses SQLite for local development and Postgres for production). Nest.js also integrates very well with TypeORM.
Heroku is used to deploy this server. It provides simple continuous deployment with decent performance for free. The server API base url is epi-use-assessment-server.herokuapp.com.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
NOTE: Unit testing has not been implemented yet
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
This project is configured to use compodoc. To generate documentation, run:
$ npm run doc
All system configuration is stored in the system environment.
These properties can be overridden using the .env
file.
An example .env file is given at /.env.example
Valid options and descriptions are given below:
- SECRET - a secret key used for JWT tokens. This should be kept secret and be reasonably long and random (string).
- ADMIN_DEFAULT_PASS - when the server first runs, there is no administrator account, hence there are no users and the system cannot be run. If no user exists, an administrator account is created with this username. (string).
- DATABASE - the name of the database (string)
- DATABASE_TYPE - the type of database (sqlite, mysql, etc.)
- DATABASE_URL - database url (contains username, password, etc. information)