Skip to content

Code Documentation (JSDoc)

Auto-generated documentation for every module, function, and type in the codebase.

Open Code Docs ↗

What's Documented

Backend (backend/src/)

ModuleDescription
database/sqlite.jsDatabase singleton — getDatabase(), closeDatabase(), getDatabaseDialect(). Detects SQLite vs PostgreSQL from DATABASE_URL
database/adapters/sqlite-adapter.jsSQLite adapter — WAL mode, better-sqlite3 wrapper
database/adapters/postgres-adapter.jsPostgreSQL adapter — pg-native/deasync, SQL dialect translation, AsyncLocalStorage transactions
database/migrationRunner.jsVersioned, dialect-aware migration runner with checksum validation
database/repositories/*.jsData access layer — projectRepo, testRepo, runRepo, activityRepo, healingRepo, userRepo, counterRepo, verificationTokenRepo, passwordResetTokenRepo, webhookTokenRepo, scheduleRepo
database/migrate.jsOne-time migration from legacy sentri-db.json → SQLite
utils/redisClient.jsShared Redis client — redis, redisSub, isRedisAvailable(), closeRedis()
utils/emailSender.jsTransactional email — sendEmail(), sendVerificationEmail(), Resend/SMTP/console transport
routes/auth.jsAuthentication — 10 endpoints (register, login, logout, refresh, me, verify, resend-verification, forgot-password, reset-password, OAuth), JWT helpers, password hashing
middleware/authenticate.jsStrategy-based auth — JWT cookie/bearer/query + trigger token, token revocation with Redis pub/sub
crawler.jsChromium-based page crawler
testRunner.jsPlaywright test execution engine
selfHealing.jsMulti-strategy selector waterfall with healing history
aiProvider.jsMulti-provider AI abstraction (Anthropic, OpenAI, Google, Ollama)
testDials.jsTest generation configuration and prompt builder

Frontend (frontend/src/)

ModuleDescription
api.jsCentralised API client — every api.* method documented with params/returns
utils/apiBase.jsAPI_BASE, API_VERSION, API_PATH constants and parseJsonResponse helper
context/AuthContext.jsxAuthProvider, useAuth() hook, login(), logout(), authFetch()

Regenerating Locally

bash
cd backend
npm run docs          # generates backend/docs-api/
open docs-api/index.html

The CI pipeline regenerates these automatically on every push to main.

Released under the MIT License.