-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs: add source installation guide #3682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jhcpeixoto
wants to merge
1
commit into
bluewave-labs:develop
Choose a base branch
from
jhcpeixoto:docs/source-installation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # Source Installation Guide | ||
|
|
||
| This guide explains how to run Checkmate without Docker. It is useful when you | ||
| want the monitoring server and web client to run directly on a host or VM. | ||
|
|
||
| Checkmate is split into two applications: | ||
|
|
||
| - `server/`: Node.js API and background monitor workers | ||
| - `client/`: React static web application | ||
|
|
||
| MongoDB is still required. Redis and the Capture agent are optional. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node.js 20 or newer | ||
| - npm | ||
| - MongoDB 6 or newer | ||
| - A reverse proxy or static file server for the built client, such as Nginx or | ||
| Caddy | ||
|
|
||
| ## 1. Prepare MongoDB | ||
|
|
||
| Create or choose a MongoDB database for Checkmate. For a local MongoDB service, | ||
| the connection string can look like this: | ||
|
|
||
| ```bash | ||
| mongodb://127.0.0.1:27017/uptime_db | ||
| ``` | ||
|
|
||
| Use a proper MongoDB user, password, and network policy for production | ||
| deployments. | ||
|
|
||
| ## 2. Build and Start the Server | ||
|
|
||
| Install dependencies and build the backend: | ||
|
|
||
| ```bash | ||
| cd server | ||
| npm install | ||
| npm run build | ||
| ``` | ||
|
|
||
| Start the server with the required environment variables: | ||
|
|
||
| ```bash | ||
| NODE_ENV=production \ | ||
| PORT=52345 \ | ||
| DB_CONNECTION_STRING="mongodb://127.0.0.1:27017/uptime_db" \ | ||
| JWT_SECRET="replace-with-a-long-random-secret" \ | ||
| CLIENT_HOST="https://checkmate.example.com" \ | ||
| node dist/index.js | ||
| ``` | ||
|
|
||
| The API will listen on `PORT`, which defaults to `52345`. | ||
|
|
||
| For production, run this command under a process manager such as `systemd`, | ||
| PM2, or your platform supervisor. | ||
|
|
||
| ## 3. Build and Serve the Client | ||
|
|
||
| The client is a static Vite build. Configure the public API URL before building: | ||
|
|
||
| ```bash | ||
| cd client | ||
| cat > .env.production <<'EOF' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is destructive and users that aren't familiar with bash commands may not know what this does. Perhaps a note to users? |
||
| VITE_APP_API_BASE_URL=https://checkmate.example.com/api/v1 | ||
| VITE_APP_CLIENT_HOST=https://checkmate.example.com | ||
| VITE_APP_LOG_LEVEL=error | ||
| EOF | ||
|
|
||
| npm install | ||
| npm run build | ||
| ``` | ||
|
|
||
| Serve `client/dist` with a static web server. A minimal Nginx server block: | ||
|
|
||
| ```nginx | ||
| server { | ||
| listen 80; | ||
| server_name checkmate.example.com; | ||
|
|
||
| root /opt/checkmate/client/dist; | ||
| index index.html; | ||
|
|
||
| location / { | ||
| try_files $uri $uri/ /index.html; | ||
| } | ||
|
|
||
| location /api/v1/ { | ||
| proxy_pass http://127.0.0.1:52345/api/v1/; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| If you serve the API on a different hostname, set `VITE_APP_API_BASE_URL` to | ||
| that public API URL and update `CLIENT_HOST` on the server to the public client | ||
| URL. | ||
|
|
||
| ## 4. Optional Capture Agent | ||
|
|
||
| Checkmate can monitor HTTP, ping, port, SSL, DNS, game, gRPC, and page speed | ||
| targets without Docker. Server infrastructure metrics require the optional | ||
| [Capture agent](https://github.com/bluewave-labs/capture). | ||
|
|
||
| Install and run Capture on each host you want to inspect, then add that host in | ||
| Checkmate as an infrastructure monitor. | ||
|
|
||
| ## Notes | ||
|
|
||
| - Docker container monitoring requires access to a Docker daemon. If you do not | ||
| run Docker, use the other monitor types. | ||
| - Keep `JWT_SECRET` stable after first startup. Changing it invalidates existing | ||
| sessions. | ||
| - Build the client again whenever the public API URL changes, because Vite | ||
| embeds these values into the static bundle. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redis is no longer used by this project.