Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 4m42s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
Deploy to Staging / Verify Staging (pull_request) Failing after 6s
Deploy to Staging / Notify Staging Ready (pull_request) Has been skipped
Deploy to Staging / Notify Staging Failure (pull_request) Successful in 6s
- Add audit_logs table with categories, severities, and indexes - Create AuditLogService and AuditLogRepository - Add REST API endpoints for viewing and exporting logs - Wire audit logging into auth, vehicles, admin, and backup features - Add desktop AdminLogsPage with filters and CSV export - Add mobile AdminLogsMobileScreen with card layout - Implement 90-day retention cleanup job - Remove old AuditLogPanel from AdminCatalogPage Security fixes: - Escape LIKE special characters to prevent pattern injection - Limit CSV export to 5000 records to prevent memory exhaustion - Add truncation warning headers for large exports 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Core Module Index
Configuration (src/core/config/)
config-loader.ts— Load and validate environment variablesdatabase.ts— PostgreSQL connection poolredis.ts— Redis client, cache helpers, and distributed lockinguser-context.ts— User context utilities
Distributed Lock Service
The DistributedLockService in redis.ts provides Redis-based distributed locking for preventing duplicate operations across multiple containers (blue-green deployments).
All scheduled jobs MUST use distributed locking to prevent duplicate execution when multiple backend containers are running.
import { randomUUID } from 'crypto';
import { lockService } from '../core/config/redis';
// Acquire lock (returns false if already held)
const lockKey = 'job:my-scheduled-task';
const lockValue = randomUUID(); // Unique identifier for this execution
const ttlSeconds = 300; // Auto-release after 5 minutes
const acquired = await lockService.acquireLock(lockKey, ttlSeconds, lockValue);
if (!acquired) {
// Another container is already running this job
return;
}
try {
// Do work...
} finally {
// Always release the lock
await lockService.releaseLock(lockKey, lockValue);
}
API:
| Method | Description |
|---|---|
acquireLock(key, ttlSeconds, lockValue) |
Acquire lock atomically (SET NX EX) |
releaseLock(key, lockValue) |
Release only if we hold it (Lua script) |
isLocked(key) |
Check if lock exists |
Plugins (src/core/plugins/)
auth.plugin.ts— Auth0 JWT via JWKS (@fastify/jwt, get-jwks)error.plugin.ts— Error handlinglogging.plugin.ts— Request logging
Logging (src/core/logging/)
logger.ts— Structured logging (Winston)
Middleware
middleware/user-context.ts— User ID extraction from JWT
Storage (src/core/storage/)
storage.service.ts— Storage abstractionadapters/filesystem.adapter.ts— Filesystem storage adapter