A lightweight "Dead Man's Switch" for cron jobs and background scripts β detect silent failures when automated tasks stop checking in.
- π Zero-config HTTP ping monitoring
- π Fully Dockerized (single container with built-in cron)
- π Production-ready security (Non-root containers, log rotation)
- π§ Adaptive grace periods
- π AI Incident history & automatic resolution (Soon)
- β±οΈ Precision Downtime Tracking
- π§ Instant email alerts (Resend)
- β‘ Modern stack: Next.js 15, Tailwind v4, Shadcn/UI, Framer Motion
SilentFailQuickWalkthrough.mp4
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Runtime | Bun (or Node.js 18+) |
| API | ElysiaJS (Route Handlers) |
| Database | PostgreSQL 16.1 + Prisma |
| Authentication | Better Auth (GitHub, Discord) |
| Resend | |
| UI | Tailwind CSS v4, Shadcn/UI, Framer Motion |
| Deployment | Docker |
Run the entire application with a single command:
# Clone
git clone https://github.com/LemonMantis5571/SilentFail.git
cd silentfail
# Create .env file
cp .env.example .env
# Edit .env with your valuesChoose your database setup:
# Option 1: Local Docker Postgres (includes database container)
docker-compose --profile local-db up -d
# Option 2: Cloud Database (Supabase, Neon, Railway, etc.)
# Just set DATABASE_URL in .env, then:
docker-compose up -dThe app will be available at http://localhost:3000
π‘ Note: The Docker image includes a built-in cron worker that automatically checks for silent failures. No separate cron service needed!
β οΈ Docker Runtime: The Docker image uses Bun as its runtime. For npm-based deployments, see Option B below.
Managing the stack:
docker-compose down # Stop all services
docker-compose down -v # Stop and remove all data
docker-compose logs -f app # View app logs
docker-compose restart app # Restart app serviceFor faster development iteration:
Using Bun (recommended):
# Start only the database
docker-compose --profile local-db up db -d
# Install dependencies
bun install
# Push database schema
bun run db:push
# Run app locally
bun run dev
# In a separate terminal, run the cron worker
bun run workerUsing npm:
# Start only the database
docker-compose --profile local-db up db -d
# Install dependencies
npm install
# Push database schema
npm run db:push
# Run app locally
npm run dev
# In a separate terminal, run the cron worker (requires ts-node or tsx)
npx tsx scripts/worker.ts# App Configuration
DATABASE_URL="postgresql://user:password@localhost:5432/silentfail"
NEXT_PUBLIC_APP_URL="https://your-domain.com" # Your deployed URL
# Authentication
BETTER_AUTH_SECRET="" # Generate: openssl rand -base64 32
BETTER_AUTH_URL="" # Same as NEXT_PUBLIC_APP_URL
# OAuth (at least one required)
BETTER_AUTH_GITHUB_CLIENT_ID=""
BETTER_AUTH_GITHUB_CLIENT_SECRET=""
# Email Alerts
RESEND_API_KEY="re_..."
EMAIL_FROM="SilentFail <alerts@yourdomain.com>"
# Cron Security
CRON_SECRET="" # Generate: openssl rand -hex 32# Server Port (default: 3000, some platforms use 8080)
PORT="3000"
# Discord OAuth
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
# Cron Configuration
CRON_INTERVAL="60" # Check interval in seconds (default: 60)
# Docker Postgres
DB_USER="silentfail"
DB_PASSWORD="securepassword"
DB_NAME="silentfail"Quick secret generation:
openssl rand -base64 32 # For BETTER_AUTH_SECRET
openssl rand -hex 32 # For CRON_SECRET- Create a monitor in the dashboard
- Add the ping URL to the end of your script:
# Ping after successful backup
pg_dump mydb > backup.sql && curl -s https://your-app.com/api/ping/abc123xyz- Get alerted if your script stops pinging within the expected interval
π See EXAMPLES.md for integration examples in Python, Node.js, Go, PHP, Ruby, PowerShell, and more.
Use the included test scripts to simulate a monitored job:
PowerShell (Windows):
.\scripts\test-monitor.ps1 -PingId your-ping-id -Interval 10Bash (Linux/Mac):
./scripts/test-monitor.sh your-ping-id 10These scripts will ping your monitor every N seconds. Stop the script with Ctrl+C to simulate a failure and test your alerting.
π‘ Note: At least one OAuth provider is required. You can use GitHub, Discord, or both.
- Go to https://github.com/settings/developers
- Click "New OAuth App"
- Set Authorization callback URL:
https://your-app.com/api/auth/callback/github - Copy Client ID and Client Secret to your environment variables
- Go to https://discord.com/developers/applications
- Create New Application β OAuth2
- Add Redirect URL:
https://your-app.com/api/auth/callback/discord - Copy Client ID and Client Secret to your environment variables
bun run db:studio # View/edit data in browser
bun run db:push # Push schema changes
bun run db:generate # Generate migrations
# Docker-specific
docker-compose down -v # Reset database (WARNING: deletes all data)
docker-compose logs db # View database logsbun run dev # Start dev server
bun run build # Build for production
bun run start # Run production build
bun run preview # Build + Start (Shortcut)
bun run check # Lint + Type check
bun run test # Run tests
bun run worker # Run cron worker locallyWhen a new version is released:
Docker users:
# Pull latest changes
git pull origin main
# Rebuild and restart containers
docker-compose down
docker-compose build --no-cache
docker-compose up -d
# If there are database schema changes
docker-compose exec app bunx prisma db pushLocal development:
# Pull latest changes
git pull origin main
# Update dependencies
bun install # or: npm install
# Apply any schema changes
bun run db:push # or: npm run db:push
# Restart your dev server
bun run dev # or: npm run dev
β οΈ Breaking Changes: Check the releases page for migration notes before updating.
- Set
NEXT_PUBLIC_APP_URLto your production domain - Generate secure values for
BETTER_AUTH_SECRETandCRON_SECRET - Configure OAuth callback URLs for your production domain
- Set up a verified domain in Resend for email alerts
- (Optional) Remove database port exposure in docker-compose.yml
- (Optional) Set up SSL/TLS with a reverse proxy
Contributions are welcome! Please feel free to submit a Pull Request.
GPL General Public License v3.0
This is a self-hosted application. If you host it publicly, you are responsible for providing your own Privacy Policy and Terms of Service.