mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-13 21:29:46 -06:00
a7de58c99b7c99facbbbe685ee679f523c553b61
BlueWave Uptime
BlueWave uptime monitoring application
Getting Started
- Clone this repository to your local machine
Client
Installation
- Change directory to the
Clientdirectory - Install all dependencies by running
npm install
Starting Development Server
- Run
npm run devto start the development server.
Server
Installation
- Change directory to the
Serverdirectory - Install all depencies by running
npm install
Configuration
Configure the server with the following environmental variables
| ENV Varialbe Name | Required/Optional | Type | Description | Accepted Values |
|---|---|---|---|---|
| JWT_SECRET | Required | string |
JWT secret | |
| DB_TYPE | Optional | string |
Specify DB to use | MongoDB | FakeDB |
| DB_CONNECTION_STRING | Required | string |
Specfies URL for MongoDB Database | |
| PORT | Optional | integer |
Specifies Port for Server | |
| MAILERSEND_API_KEY | Required | string |
Specfies API KEY for MailerSend service | |
| SYSTEM_EMAIL_ADDRESS | Required | string |
Specfies System email to be used in emailing service |
Starting the Development Server
- run
npm run devto start the development server
Endpoints
All endpoints return a response in this format:
| Name | Type | Notes |
|---|---|---|
| success | boolean |
Success or failure of request |
| msg | string |
Message describing response |
| data | Object |
Arbitrary Payload |
Example:
{success: true, msg: "Successful Request", data: {test: testData}}
Data Types
User
| Name | Type | Notes |
|---|---|---|
| firstname | string |
First name |
| lastname | string |
Last name |
string |
User's email | |
| profilePicUrl | string |
URL to User's picture |
| isActive | boolean |
Default to true |
| isVerified | boolean |
Default to false |
| updated_at | Date |
Last update time |
| created_at | Date |
Time created at |
Monitor
| Name | Type | Notes |
|---|---|---|
| userId | string |
Unique ID identifying monitor creator |
| name | string |
Name of the monitor |
| description | string |
Description of the monitor |
| url | string |
Url the monitor will ping |
| isActive | boolean |
Whether or not the monitor is active |
| interval | integer |
Interval with which to ping monitor (ms) |
| updatedAt | Date |
Last time the monitor was updated |
| CreatedAt | Date |
When the monitor was updated |
POST /api/v1/auth/register
Method/Headers
Method/Headers Value Method POST content-type application/json
Body
Name Type Notes firstname stringlastname stringstringValid email address password stringMin 8 chars
Response Payload
Type Notes JWT JSON Web Token containing a User
Sample CURL request
curl --request POST \
--url http://localhost:5000/api/v1/auth/register \
--header 'Content-Type: application/json' \
--data '{
"firstname" : "User First Name",
"lastname": "User Last Name",
"email" : "user@gmail.com",
"password": "user_password"
}'
Sample Response
{
"success": true,
"msg": "User created}",
"data": {
"_id": "6645079aae0b439371913972",
"firstname": "User First Name",
"lastname": "User Last Name",
"email": "user@gmail.com",
"isActive": true,
"isVerified": false,
"updated_at": "2024-05-15T19:06:02.720Z",
"created_at": "2024-05-15T19:06:02.720Z",
"__v": 0
}
}
POST /api/v1/auth/login
Method/Headers
Method/Headers Value Method POST content-type application/json
Body
Name Type Notes stringValid email address password stringMin 8 chars
Response Payload
Type Notes JWT JSON Web Token Containing a User
Sample CURL request
curl --request POST \
--url http://localhost:5000/api/v1/auth/login \
--header 'Content-Type: application/json' \
--data '{
"email" : "user@gmail.com",
"password": "user_password"
}'
Sample response
{
"success": true,
"msg": "Found user",
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NjQ1MDc5YWFlMGI0MzkzNzE5MTM5NzIiLCJmaXJzdG5hbWUiOiJBbGV4IiwibGFzdG5hbWUiOiJIb2xsaWRheSIsImVtYWlsIjoiYWpob2xsaWRAZ21haWwuY29tIiwiaXNBY3RpdmUiOnRydWUsImlzVmVyaWZpZWQiOmZhbHNlLCJ1cGRhdGVkX2F0IjoiMjAyNC0wNS0xNVQxOTowNjowMi43MjBaIiwiY3JlYXRlZF9hdCI6IjIwMjQtMDUtMTVUMTk6MDY6MDIuNzIwWiIsIl9fdiI6MCwiaWF0IjoxNzE2Mzk5MDM2fQ.clFR01gh5XK9DtLjB-_JLxMBAzBZuduRQv3ZzqHuTRY"
}
GET /api/v1/monitors
Method/Headers
Method/Headers Value Method GET
Response Payload
Type Notes Array[Monitor]Array of monitors
GET /api/v1/monitor/{id}
Method/Headers
Method/Headers Value Method GET
Response Payload
Type Notes MonitorSingle monitor with the id in the request parameter
GET /api/v1/monitors/user/{userId}
Method/Headers
Method/Headers Value Method GET
Request Payload
Type Notes Array[Monitor]Array of monitors created by user with userId specified in request
Contributors
Languages
JavaScript
90.5%
TypeScript
6.8%
Shell
1.7%
CSS
0.7%
Dockerfile
0.3%