Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
4ffc285
spec: add org check rate limiting with proportional fair scaling
fclairamb Mar 29, 2026
14c4b1e
feat: add `make dev` target for non-test development mode
fclairamb Apr 2, 2026
715c630
fix: mark internal checks with internal=true and remove type prefix
fclairamb Apr 5, 2026
c09f200
docs: reorganize docs/ into logical subdirectories
fclairamb Apr 5, 2026
32416d0
feat: add ResultStatusCreated (6) so initial check results display as…
fclairamb Apr 5, 2026
09584df
docs: update all documentation to match current source code
fclairamb Apr 5, 2026
466e784
refactor: reorder result/check status values to follow lifecycle order
fclairamb Apr 5, 2026
ede9d2e
refactor: replace CheckStatusUnknown with CheckStatusCreated
fclairamb Apr 5, 2026
b254848
fix: use "unknown" as defensive fallback for missing status in frontend
fclairamb Apr 5, 2026
5a052a4
fix: use green calendar icon for resolved incidents in events page
fclairamb Apr 5, 2026
8418986
fix: ignore "created" results in graph coloring and availability calc…
fclairamb Apr 5, 2026
c29b768
fix: allow deleting checks with active incidents
fclairamb Apr 5, 2026
50dcb26
fix: also skip running status in availability and add badge refresh b…
fclairamb Apr 5, 2026
7e21ab8
fix: resolve lint issues - gci formatting and variable shadowing
fclairamb Apr 5, 2026
67eacf3
fix: resolve remaining variable shadowing in DeleteCheck
fclairamb Apr 5, 2026
c6c13ec
fix: update tests to use new result status enum values
fclairamb Apr 5, 2026
87a88e2
fix: update remaining tests and docs for reordered result status values
fclairamb Apr 5, 2026
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
60 changes: 0 additions & 60 deletions .claude/commands/implement-todos.md

This file was deleted.

96 changes: 69 additions & 27 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,30 @@ If the server is currently running on port 4000, you can just apply code changes
wait 5s for it to build and then test your changes.

1. Start infrastructure: `docker-compose up -d`
2. Backend: `make dev-backend` for development server
3. Dashboard: `make dev-dash0` for development server
2. Run everything: `make dev` (backend + dash0 + status0 with hot reload)
3. Or in test mode: `make dev-test` (same but with `SP_RUNMODE=test`)
4. Database changes: Add migrations, run `make migrate`

## Common Makefile Targets
- **Build**:
- `make build` - Build complete application (dash + dash0 + backend)
- `make build` - Build complete application (dash + dash0 + status0 + backend)
- `make build-dash` - Build dash only (using bun)
- `make build-dash0` - Build dash0 status page only (using bun)
- `make build-status0` - Build status0 public status page only (using bun)
- `make build-backend` - Build backend only (Go binary)
- `make build-cli` - Build standalone CLI (`sp`) binary
- `make install-cli` - Install standalone CLI to GOPATH
- `make docker-build` - Build Docker image
- **Development**:
- `make dev-backend` - Start backend development server
- `make dev-dash` - Start dash development server
- `make dev-dash0` - Start dash0 development server
- `make dev-test` - Run backend and dash0 in development test mode
- `make dev` - Run backend, dash0 and status0 in development mode
- `make dev-test` - Run backend, dash0 and status0 in development test mode
- `make dev-backend` - Start backend development server only
- `make dev-dash` - Start dash development server only
- `make dev-dash0` - Start dash0 development server only
- `make dev-status0` - Start status0 development server only
- **Run**:
- `make run` - Build and run the application
- `make run-test` - Build and run the application in test mode
- **Testing**:
- `make test` - Run backend tests
- `make test-dash` - Run dash tests
Expand All @@ -56,7 +64,7 @@ wait 5s for it to build and then test your changes.
- `make deps` - Install all dependencies
- `make migrate` - Run database migrations
- `make clean` - Remove built binaries and artifacts
- `make run` - Build and run the application
- `make clean-all` - Remove all generated files including node_modules

## Default credentials
- User: `admin@solidping.com`
Expand All @@ -76,21 +84,48 @@ wait 5s for it to build and then test your changes.
- Use camelCase consistently for both JSON properties and query parameters (e.g., `checkUid` in JSON and `?checkUid=abc` in URLs)
- When using query parameters that can contain multiple values, use them in their singular form, for example `checkUid` and not `checkUids`. If there are multiple values, separate them with `,`.

### API Endpoints
- GET /api/mgmt/version - Get the current version
- GET /api/mgmt/health - Health check endpoint
- POST /api/v1/auth/login - User/password authentication (org optional in body)
- POST /api/v1/auth/logout - Logout current session
- POST /api/v1/auth/refresh - Refresh access token
- GET /api/v1/auth/me - Get current user info
- POST /api/v1/auth/switch-org - Switch organization context
- GET /api/v1/auth/tokens - List all user's tokens across orgs
- DELETE /api/v1/auth/tokens/$tokenUid - Revoke a token
- GET /api/v1/orgs/$org/tokens - List user's tokens for an org
- POST /api/v1/orgs/$org/tokens - Create a Personal Access Token for an org
- GET /api/v1/check-types - List all check types with metadata and server-level activation status
- GET /api/v1/check-types/samples - List sample configs for all check types (optional ?type= filter)
- GET /api/v1/orgs/$org/check-types - List check types resolved for the org (server + org settings)
### API Endpoints (key routes, see `docs/api-specification.md` for full list)
- GET /api/mgmt/version - Version info
- GET /api/mgmt/health - Health check
- POST /api/v1/auth/login - Login (org optional in body)
- POST /api/v1/auth/logout - Logout
- POST /api/v1/auth/refresh - Refresh token
- GET /api/v1/auth/me - Current user info
- PATCH /api/v1/auth/me - Update current user
- POST /api/v1/auth/switch-org - Switch organization
- POST /api/v1/auth/register - Register new user
- POST /api/v1/auth/2fa/setup|confirm|verify|recovery - 2FA management
- GET /api/v1/auth/tokens - List all user tokens
- DELETE /api/v1/auth/tokens/$tokenUid - Revoke token
- GET /api/v1/auth/providers - List OAuth providers
- POST /api/v1/orgs - Create organization
- GET/PATCH /api/v1/orgs/$org/settings - Org settings
- GET/POST /api/v1/orgs/$org/tokens - Org tokens
- GET/POST/DELETE /api/v1/orgs/$org/invitations - Invitations
- CRUD /api/v1/orgs/$org/members - Members
- CRUD /api/v1/orgs/$org/checks - Checks
- POST /api/v1/orgs/$org/checks/validate - Validate check config
- GET/POST /api/v1/orgs/$org/checks/export|import - Import/export
- PUT /api/v1/orgs/$org/checks/$slug - Upsert by slug
- CRUD /api/v1/orgs/$org/check-groups - Check groups
- CRUD /api/v1/orgs/$org/connections - Integration connections
- GET/PUT/POST/DELETE /api/v1/orgs/$org/checks/$check/connections - Check connections
- GET /api/v1/orgs/$org/results - Results
- GET /api/v1/orgs/$org/incidents[/$uid[/events]] - Incidents
- GET /api/v1/orgs/$org/events - Events
- CRUD /api/v1/orgs/$org/status-pages (with nested sections/resources)
- CRUD /api/v1/orgs/$org/maintenance-windows (with nested checks)
- CRUD /api/v1/orgs/$org/jobs - Background jobs
- GET /api/v1/check-types - List check types (public)
- GET /api/v1/check-types/samples - Sample configs (public)
- GET /api/v1/orgs/$org/check-types - Org check types
- GET /api/v1/regions - Global regions (public)
- GET/POST /api/v1/heartbeat/$org/$identifier - Heartbeat ingestion (public)
- GET /api/v1/orgs/$org/checks/$check/badges/$format - Status badges (public)
- GET /api/v1/status-pages/$org[/$slug] - Public status pages
- POST /api/v1/workers/register|heartbeat|claim-jobs|submit-result - Worker API
- POST /api/v1/mcp - MCP endpoint
- GET/PUT/DELETE /api/v1/system/parameters - System params (super admin)

### Errors
All errors should return:
Expand All @@ -105,9 +140,16 @@ All errors should return:
- `UNAUTHORIZED` - Authentication required
- `FORBIDDEN` - Permission denied
- `CONFLICT` - Resource conflict (duplicate, etc.)
- `ORGANIZATION_NOT_FOUND` - Organization does not exist
- `USER_NOT_FOUND` - User does not exist
- `CHECK_NOT_FOUND` - Check does not exist
- `INVALID_CREDENTIALS` - Wrong email/password
- `INVALID_TOKEN` / `NO_TOKEN` - Token issues
- `REGISTRATION_DISABLED` / `EMAIL_NOT_ALLOWED` / `REGISTRATION_EXPIRED` - Registration errors
- `INVITATION_NOT_FOUND` / `INVITATION_EXPIRED` - Invitation errors
- `PASSWORD_RESET_EXPIRED` - Password reset timeout
- `2FA_REQUIRED` / `INVALID_2FA_CODE` / `INVALID_RECOVERY_CODE` - 2FA errors
- `CHECK_HAS_ACTIVE_INCIDENTS` - Cannot delete check with active incidents
- `ORGANIZATION_NOT_FOUND` / `USER_NOT_FOUND` / `CHECK_NOT_FOUND` / `CONNECTION_NOT_FOUND` - Resource not found
- `STATUS_PAGE_NOT_FOUND` / `STATUS_PAGE_SECTION_NOT_FOUND` / `CHECK_GROUP_NOT_FOUND` - Resource not found
- `MAINTENANCE_WINDOW_NOT_FOUND` / `TOKEN_NOT_FOUND` - Resource not found

### API Testing
```bash
Expand All @@ -132,7 +174,7 @@ make build-cli
```

## Frontend Error Handling
See `docs/frontend_error_conventions.md` for full details.
See `docs/conventions/frontend-errors.md` for full details.

**Key rules:**
- **401**: Redirect to login with `?returnTo={currentPath}` to preserve navigation
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: docker-build build build-backend build-dash build-dash0 build-status0 copy-dash copy-dash0 copy-status0 \
build-cli install-cli clean clean-all run run-test dev-test dev-dash dev-dash0 dev-status0 dev-backend \
build-cli install-cli clean clean-all run run-test dev dev-test dev-dash dev-dash0 dev-status0 dev-backend \
test test-dash lint lint-back lint-dash fmt deps migrate help
.DEFAULT_GOAL := build

Expand Down Expand Up @@ -117,6 +117,13 @@ run-test: build ## Build and run the application in test mode
@echo "Running application in test mode..."
@SP_RUNMODE=test ./$(APP_NAME) serve

dev: kill ## Run backend, dash0 and status0 in development mode
@echo "Running application in development mode..."
@mkdir -p $(LOG_DIR)
@cd $(DASH0_DIR) && bun run dev 2>&1 | tee $(CURDIR)/$(LOG_DIR)/dash0.log &
@cd $(STATUS0_DIR) && bun run dev 2>&1 | tee $(CURDIR)/$(LOG_DIR)/status0.log &
@cd $(BACK_DIR) && SP_REDIRECTS="/dash0:localhost:5174/dash0,/status0:localhost:5175/status0" air 2>&1 | tee $(CURDIR)/$(LOG_DIR)/backend.log

dev-test: kill ## Run backend, dash0 and status0 in development test mode
@echo "Running application in development test mode..."
@mkdir -p $(LOG_DIR)
Expand Down
29 changes: 29 additions & 0 deletions docs/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# docs/ — Documentation Directory

Claude has full authority to organize this directory. It may rename, move, split, merge, or restructure any file or subdirectory here as it sees fit to keep the documentation clear, discoverable, and maintainable.

## Organization Rules

- **README.md** is the index — it must list every document with a one-line description
- Use subdirectories to group related documents (conventions/, testing/, etc.)
- Use lowercase kebab-case for all file and directory names
- Keep filenames short and descriptive — drop redundant suffixes like `_conventions`
- Competitive analysis lives in `competitors/`
- JSON configs and manifests live near their related docs
- When reorganizing, update all cross-references in CLAUDE.md and specs/

## Current Structure

```
docs/
README.md # Full index
CLAUDE.md # This file
architecture.md # System architecture overview
api-specification.md # REST API specification
database-model.md # Database schema & tables
conventions/ # All project conventions
testing/ # Test infrastructure & fixtures
slack/ # Slack app manifests
research/ # Tool evaluations & comparisons
competitors/ # Competitor analysis
```
49 changes: 49 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SolidPing Documentation

## Architecture & Design

- [architecture.md](architecture.md) — System architecture: handler-service pattern, multi-tenancy, distributed checks, data model, scalability
- [api-specification.md](api-specification.md) — Complete REST API specification: auth, orgs, users, workers, checks, results, config
- [database-model.md](database-model.md) — Database schema with all 28 tables, columns, foreign keys, and design patterns

## Conventions

Project-wide standards and naming rules.

- [conventions/database.md](conventions/database.md) — Table naming, soft deletes, audit trails
- [conventions/checker-config.md](conventions/checker-config.md) — Checker configuration for all protocol types (HTTP, TCP, DNS, SMTP, etc.)
- [conventions/checker-metrics.md](conventions/checker-metrics.md) — Metrics compaction suffixes (_min, _max, _avg, _pct, etc.)
- [conventions/regions.md](conventions/regions.md) — Region naming (`$continent-$region-$city`) and wildcard matching
- [conventions/state-entries.md](conventions/state-entries.md) — State entries table for Slack thread metadata
- [conventions/frontend-urls.md](conventions/frontend-urls.md) — Dashboard URL routing (`/dash/orgs/{orgSlug}/...`)
- [conventions/frontend-errors.md](conventions/frontend-errors.md) — Frontend error handling by HTTP status code

## Testing

- [testing/e2e-ci.md](testing/e2e-ci.md) — E2E test infrastructure: CI environment, Playwright config, local execution
- [testing/http-test-checks.md](testing/http-test-checks.md) — Fake API test checks: 5 predefined scenarios (stable, flaky, unstable, slow, 503)

## Integrations

- [slack/manifest-dev.json](slack/manifest-dev.json) — Slack app manifest for development
- [slack/manifest-prod.json](slack/manifest-prod.json) — Slack app manifest for production

## Research

- [research/screenshot-tools.md](research/screenshot-tools.md) — Go screenshot tools comparison (chromedp, Rod, gowitness, gochro) — Rod recommended

## Competitors

Market analysis of uptime monitoring services.

- [competitors/comparison.md](competitors/comparison.md) — Comparison matrix and pricing across 6 competitors
- [competitors/criteria.md](competitors/criteria.md) — Evaluation framework: pricing, features, protocols, deployment, support
- [competitors/full-list.md](competitors/full-list.md) — Comprehensive directory of all monitoring services
- [competitors/betterstack.md](competitors/betterstack.md) — BetterStack Uptime analysis
- [competitors/checkly.md](competitors/checkly.md) — Checkly analysis (monitoring-as-code, Playwright)
- [competitors/gatus.md](competitors/gatus.md) — Gatus analysis (config-as-code, self-hosted)
- [competitors/healthchecks-io.md](competitors/healthchecks-io.md) — Healthchecks.io analysis (passive/heartbeat monitoring)
- [competitors/pingdom.md](competitors/pingdom.md) — Pingdom analysis (RUM, page speed)
- [competitors/statuscake.md](competitors/statuscake.md) — StatusCake analysis (43 probe locations)
- [competitors/uptime-kuma.md](competitors/uptime-kuma.md) — Uptime Kuma analysis (self-hosted, Vue.js)
- [competitors/uptimerobot.md](competitors/uptimerobot.md) — UptimeRobot analysis (free tier, protocol support)
Loading