Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/arxiver/watch-site

Watch site is an uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about their availability, average response time, and total uptime/downtime built using NestJs
https://github.com/arxiver/watch-site

authentication authorization backend javascript jwt mongodb monitoring nest nestjs nestjs-backend scheduler schudler typeorm typescript watch watchdog

Last synced: about 1 month ago
JSON representation

Watch site is an uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about their availability, average response time, and total uptime/downtime built using NestJs

Awesome Lists containing this project

README

        

# Watch-site
Watch site is an uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about their availability, average response time, and total uptime/downtime in a given period of time.

### Context:

- [x] Signup with email verification.
- [x] CRUD operations for URL checks (`GET`, `PUT` and `DELETE` can be called only by the user user who created the check).
- [x] Authenticated users can receive a notification whenever one of their URLs goes down or up again:
- [x] Email.
- [x] Webhook *(optional)*.
- [x] Authenticated users can get detailed uptime reports about their URLs availability, average response time, and total uptime/downtime.

**VISIT: [TASK.md](./TASK.md) FOR MORE DETAILS**

## System design diagram

![system-design](./assets/design.png)

## API

![api-docs](./assets/api.png)


**VISIT: [API.md](./API.md) FOR MORE DETAILS**

## Installation

```bash
$ npm install --legacy-peer-deps
```

### Database Setup
1. Make sure you are having mongodb installed on your machine or in cloud & running server.
2. Configure the mongodb connection string in `config/env/dev.env` file.

Make sure to configure all the environment variables in `config/env/dev.env` file.

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
```

## Test

#### Tests are not yet implemented but the test strategy is as follows:
- Unit tests for all the services and controllers.
- Create a mock-server for testing the DOWNS/UPS notifications.

```bash
# unit tests
$ npm run test

# test coverage
$ npm run test:cov
```

## Stack

- Backend Framework: NodeJS (v18)
- Language: TypeScript
- Server Framework: NestJS
- Database: Mongodb
- Testing Framework: JestJS
- API Documentation: Swagger

## TODO

- [ ] Dockerization
- [ ] unit testing
- [ ] e2e testing