Installing Checkmate
Quickstart for users (quick method)
Download our Docker compose file
Run
docker compose up
to start the applicationNow the application is running at
http://localhost
Optional Config:
If you want to monitor Docker containers, uncomment this line in
docker-compose.yaml
:
This gives the app access to your docker daemon via unix socket, please be aware of what you are doing.
Quickstart for users (remote server)
Download our Docker compose file
Edit the
UPTIME_APP_API_BASE_URL
variable in the docker-compose file to point to your remote server.Run
docker compose up
to start the applicationNow the application is running at
http://<remote_server_ip>
Optional Config:
If you want to monitor Docker containers, uncomment this line in
docker-compose.yaml
:
This gives the app access to your docker daemon via unix socket, please be aware of what you are doing.
Quickstart for developers
Make sure you change the directory to the specified directories, as paths in commands are relative.
Cloning and initial setup
This application consists of a frontend (client) and a backend (server). We recommend you create a directory, let's call it checkmate
, to hold both the Client and the Server in one location.
CD into your
checkmate
directoryClone the Client repository. We'll refer to this directory as
client
Clone the Server repository. We'll refer to this directory as
server
Setting up Docker images
This application requires a MongoDB instance and a Redis instance. If you want, you can use our Docker images. Otherwise you can provide your own instances.
From your
checkmate
directory you created above, CD intoserver/docker/dev
.Run
docker run -d -p 6379:6379 -v $(pwd)/redis/data:/data --name uptime_redis uptime_redis
Run
docker run -d -p 27017:27017 -v $(pwd)/mongo/data:/data/db --name uptime_database_mongo uptime_database_mongo
Server set up
The server requires some configuration in order to run.
From your
checkmate
directory, CD into theserver
directory.Run
npm install
.In the
server
directory, create a.env
file to hold your configuration.Add the required environmental variables.
Start the
server
by runningnpm run dev
.
Client set up
The client also requires some configuration in order to run.
From your
checkmate
directory, CD into theclient
directory.Run
npm install
.In the
client
directory, create a.env
file to hold your configuration.Add the required environmental variables.
Start the
client
by runningnpm run dev
Access the application
The
client
is running atlocalhost:5173
(unless you changed the default port).The
server
is running atlocalhost:5000
(unless you changed the default port).
Client env vars
Change directory to the
Client
directoryInstall all dependencies by running
npm install
Add a
.env
file to theClient
directory with the following options:
Environment variables
VITE_APP_API_BASE_URL
Required
string
Base URL of server
{host}/api/v1
VITE_APP_LOG_LEVEL
Optional
string
Log level
"none"
|"error"
| "warn"
|
VITE_APP_DEMO
Optional
boolean
Demo server or not
true
|false
|
Sample ENV file:
Server env vars
Change the directory to the
Server
directoryInstall all dependencies by running
npm install
Add a
.env
file to theServer
directory with the following options:
Environment variables
Configure the server with the following environmental variables:
CLIENT_HOST
Required
string
Frontend Host
JWT_SECRET
Required
string
JWT secret
REFRESH_TOKEN_SECRET
Required
string
Refresh JWT secret
DB_TYPE
Optional
string
Specify DB to use
MongoDB | FakeDB
DB_CONNECTION_STRING
Required
string
Specifies URL for MongoDB Database
PORT
Optional
integer
Specifies Port for Server
LOGIN_PAGE_URL
Required
string
Login url to be used in emailing service
REDIS_HOST
Required
string
Host address for Redis database
REDIS_PORT
Required
integer
Port for Redis database
TOKEN_TTL
Optional
string
Time for token to live
In vercel/ms format https://github.com/vercel/ms
REFRESH_TOKEN_TTL
Optional
string
Time for refresh token to live
PAGESPEED_API_KEY
Optional
string
API Key for PageSpeed requests
SYSTEM_EMAIL_HOST
Required
string
Host to send System Emails From
SYSTEM_EMAIL_PORT
Required
number
Port for System Email Host
SYSTEM_EMAIL_ADDRESS
Required
string
System Email Address
SYSTEM_EMAIL_PASSWORD
Required
string
System Email Password
Sample env file
API documentation
Our API is documented in accordance with the OpenAPI spec.
You can see the documentation on your local development server at http://localhost:{port}/api-docs
You can also view the documentation on our demo server at https://uptime-demo.bluewavelabs.ca/api-docs
Error handling
Errors are returned in a standard format:
{"success": false, "msg": "No token provided"}
Errors are handled by error handling middleware and should be thrown with the following parameters
status
integer
500
Standard HTTP codes
message
string
"Something went wrong"
An error message
service
string
"Unknown Service"
Name of service that threw the error
Example:
Errors should not be handled at the controller level and should be left to the middleware to handle.
Last updated
Was this helpful?