Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Environment Variables

This document describes the environment variables used by Checkmate server.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the required client env vars

VITE_APP_API_BASE_URL
VITE_APP_CLIENT_HOST

Copy `server/.env.example` to `server/.env` and fill in your values.

## Required Variables

| Variable | Description | Example |
|----------|-------------|---------|
| `DB_CONNECTION_STRING` | MongoDB connection string | `mongodb://localhost:27017/uptime_db` |
| `JWT_SECRET` | Secret key for JWT tokens | `my_secret` |

## Optional Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `NODE_ENV` | Application environment | `development` |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing PORT var

| `LOG_LEVEL` | Logging level | `debug` |
| `TOKEN_TTL` | JWT token expiry time | `99d` |
| `CLIENT_HOST` | Frontend URL | `http://localhost:5173` |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLIENT_HOST is required

| `ORIGIN` | Allowed CORS origin | `localhost` |

## Notes

- The server reads these variables from `server/.env`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All vars are read from server/.env, this line seems to indicate that only JWT_SECRET and TOKEN_TTL are read from .env. This line can just be removed safely.

- `JWT_SECRET` should be a strong, unique value in production
- `TOKEN_TTL` accepts any format valid for `ms` (e.g., `1h`, `7d`, `99d`)
Loading