diff --git a/README.md b/README.md index 8767a3633..a86b460e4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ BlueWave uptime monitoring application 1. [Installation (Client)](#client) 2. [Installation (Server)](#server) 3. [Configuration(Server)](#config-server) + - [Environment](#environmental-variables) + - [Database](#databases) + - [Docker Images](#docker-images) 4. [Endpoints](#endpoints) - POST [/api/v1/auth/register](#post-register) - POST [/api/v1/auth/login](#post-login) @@ -46,9 +49,11 @@ BlueWave uptime monitoring application --- -#### Configuration {#config-server} +#### Configuration -Configure the server with the following environmental variables +##### Environmental Variables + +Configure the server with the following environmental variables: | ENV Variable Name | Required/Optional | Type | Description | Accepted Values | | -------------------- | ----------------- | --------- | ----------------------------------------------------- | ------------------- | @@ -61,6 +66,45 @@ Configure the server with the following environmental variables --- +##### Databases + +This project requires a number of databases to run: + +1. Main database for the application. This project includes an implementation for a MongoDB database as well as a MongoDB Docker image. +2. A Redis database is required for the Queue implementation in the PingService. This project includes a Redis docker image. + +You may run your own databases locally, or you may use the docker images included in the project to get up and running quickly. + +###### (Optional) Running Docker Images + +Docker images are located in `./Server/docker` + +
+MongoDB Image +Located in `./Server/docker/mongo` + +The `./Server/docker/mongo/mongo_data` folder should be mounted to the MongoDB container in order to persist data. + +From the `mongo` folder run + +1. Build the image: `docker build -t .` +2. Run the docker image: `docker run -d -p 27017:27017 -v $(pwd)/../mongo/mongo_data:/data/db --name uptime_database_mongo uptime_database_mongo` + +
+
+Redis Image +Located in `./Server/docker/redis` + +the `./Server/docker/redis/redis_data` folder should be mounted to the Redis container in order to persist data. + +From the `Redis` folder run + +1. Build the image: `docker build -t ` +2. Run the image: `docker run -d -p 6379:6379 -v $(pwd)/../redis/redis_data:/data --name uptime_redis uptime_redis` +
+ +--- + #### Starting the Development Server 1. run `npm run dev` to start the development server @@ -122,15 +166,15 @@ Example:
Check -| Name | Type | Notes | -| ----------- | --------- | ------------------------------------------------| -| monitorId | `string` | Unique ID for the monitor | -| status | `boolean` | Indicates the service is Up or Down | -| responseTime| `integer` | Indicates the response time of the service (ms) | -| statusCode | `integer` | Status Code returned from the service | -| message | `string` | Message returned from the service | -| updatedAt | `Date` | Last time the check was updated | -| CreatedAt | `Date` | When the check was created | +| Name | Type | Notes | +| ------------ | --------- | ----------------------------------------------- | +| monitorId | `string` | Unique ID for the monitor | +| status | `boolean` | Indicates the service is Up or Down | +| responseTime | `integer` | Indicates the response time of the service (ms) | +| statusCode | `integer` | Status Code returned from the service | +| message | `string` | Message returned from the service | +| updatedAt | `Date` | Last time the check was updated | +| CreatedAt | `Date` | When the check was created |
@@ -138,17 +182,16 @@ Example: Alert | Name | Type | Notes | -| ----------- | --------- | --------------------------------------------------| +| ----------------- | --------- | ------------------------------------------------- | | checkId | `string` | Unique ID for the check | -| status | `boolean` | Indicates the service is Up or Down | +| status | `boolean` | Indicates the service is Up or Down | | message | `string` | Message for the user about the down service | | notifiedStatus | `boolean` | Indicates whether the user is notified | | acknowledgeStatus | `boolean` | Indicates whether the user acknowledged the alert | | updatedAt | `Date` | Last time the alert was updated | | CreatedAt | `Date` | When the alert was created | - ---- +##
POST /api/v1/auth/register @@ -636,7 +679,7 @@ curl --request POST \ --- -### Error handling {#error-handling} +### Error handling Errors are returned in a standard format: diff --git a/Server/.gitignore b/Server/.gitignore index 3fdb59050..51b2eb44c 100644 --- a/Server/.gitignore +++ b/Server/.gitignore @@ -1,3 +1,6 @@ node_modules .env -*.log \ No newline at end of file +*.log +*.sh +docker/mongo/mongo_data/* +docker/redis/redis_data/* \ No newline at end of file diff --git a/Server/docker/mongo/Dockerfile b/Server/docker/mongo/Dockerfile new file mode 100644 index 000000000..fa79e8a92 --- /dev/null +++ b/Server/docker/mongo/Dockerfile @@ -0,0 +1,2 @@ +FROM mongo +EXPOSE 27017 \ No newline at end of file diff --git a/Server/docker/redis/Dockerfile b/Server/docker/redis/Dockerfile new file mode 100644 index 000000000..af68ec61e --- /dev/null +++ b/Server/docker/redis/Dockerfile @@ -0,0 +1,2 @@ +FROM redis +EXPOSE 6379 \ No newline at end of file