An open API service indexing awesome lists of open source software.

https://github.com/flippingbitss/pma-web-api

REST api to power the patient monitoring app as part of COMP-308 project
https://github.com/flippingbitss/pma-web-api

Last synced: over 1 year ago
JSON representation

REST api to power the patient monitoring app as part of COMP-308 project

Awesome Lists containing this project

README

          

## ❯ Table of Contents

- [Getting Started](#-getting-started)
- [Scripts and Tasks](#-scripts-and-tasks)
- [API Routes](#-api-routes)
- [Logging](#-logging)
- [License](#-license)

## ❯ Getting Started

### Step 1: Set up the Development Environment

You need to set up your development environment before you can do anything.

Install [Node.js and NPM](https://nodejs.org/en/download/)

- on OSX use [homebrew](http://brew.sh) `brew install node`
- on Windows use [chocolatey](https://chocolatey.org/) `choco install nodejs`

### Step 2: Clone the Project

Download this project

Then copy the `.env.example` file and rename it to `.env`. In this file you have to add your database connection information.

Create a new database with the name you have in your `.env`-file.

Then setup your application environment.

```bash
npm install
```

> This installs all dependencies. So after that your development environment is ready to use.

### Step 3: Serve your App

Go to the project dir and start your app with this npm script.

```bash
npm start serve
```

> This starts a local server using `nodemon`, which will watch for any file changes and will restart the sever according to these changes.
> The server address will be displayed to you as `http://0.0.0.0:3000`.

## ❯ Scripts and Tasks

All script are defined in the `package-scripts.js` file, but the most important ones are listed here.

### Install

- Install all dependencies with `npm install`

### Running in dev mode

- Run `npm start serve` to start nodemon with ts-node, to serve the app.
- The server address will be displayed to you as `http://0.0.0.0:3000`

### Building the project and run it

- Run `npm start build` to generated all JavaScript files from the TypeScript sources (There is also a vscode task for this called `build`).
- To start the builded app located in `dist` use `npm start`.

## ❯ API Routes

The route prefix is `/api` by default, but you can change this in the .env file.
The swagger and the monitor route can be altered in the `.env` file.

| Route | Description |
| -------------- | ----------- |
| **/api** | Shows us the name, description and the version of the package.json |
| **/swagger** | This is the Swagger UI with our API documentation |
| **/monitor** | Shows a small monitor page for the server |
| **/api/users** | Example entity endpoint |

## ❯ License

[MIT](/LICENSE)