Installing Uptime Manager
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
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>
Quickstart for developers
Make sure you change the directory to the specified directories, as paths in commands are relative.
Cloning and initial setup
Clone this repository.
Checkout the
develop
branchgit checkout develop
Setting up Docker images
Change directory to the
Docker/dev
directoryBuild the docker images by running the
build_images.sh
scriptRun
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 setup
CD to
Server
directory, and runnpm install
While in
Server
directory, create a.env
file with the required environmental variablesWhile in the
Server
directory, runnpm run dev
Client setup
CD to
Client
directoryrun npm install
While in the
Client
directory, create a.env
file with the required environmental variablesWhile in the
Client
directory runnpm run dev
Access the application
Client is now running at
localhost:5173
Server is now running at
localhost:5000
Manual installation
Client installation
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
Starting the Client development server
Run
npm run dev
to start the development server.
Server Installation
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:
Databases
This project requires two databases:
Main application database: The project uses MongoDB for its primary database, with a MongoDB Docker image provided for easy setup.
Redis for queue management: A Redis database is used for the PingService’s queue system, and a Redis Docker image is included for deployment.
You may use the included Dockerfiles to spin up databases quickly if you wish.
(Optional) Dockerised databases
Dockerfiles for the server and databases are located in the Docker
directory
Starting the development server
run
npm run dev
to start the development server
or,
run
node index.js
to start server
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
Example:
Errors should not be handled at the controller level and should be left to the middleware to handle.
Last updated