An SSL certificate monitoring application that automatically discovers deployments from AWS Route53 DNS records, checks their SSL certificates, and alerts administrators before certificates expire.
- π Automatic Discovery: Fetches deployment domains from AWS Route53
- π Real-time Dashboard: View all SSL certificates with expiration status
- β° Automated Monitoring: Hourly certificate checks via scheduled jobs
- π§ Email Alerts: Configurable expiration alerts via Postmark
- π Background Refresh: Long-running certificate checks with progress tracking
- π Batch Processing: Efficiently handles thousands of domains
- π¨ Modern UI: Beautiful React interface with dark mode support
- React with TypeScript
- Vite for fast development
- TailwindCSS + shadcn/ui for styling
- React Router for navigation
- Axios for API calls
- Node.js + Express
- TypeScript for type safety
- MongoDB with Mongoose
- AWS SDK for Route53 integration
- node-cron for scheduled jobs
- Postmark for email delivery
- JWT for authentication
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- MongoDB (local or cloud instance)
- AWS Account with Route53 access
- Postmark Account for sending emails
git clone <repository-url>
cd CertWatcher
# Install root dependencies
npm install
# Install client dependencies
cd client && npm install && cd ..
# Install server dependencies
cd server && npm install && cd ..
# Install shared dependencies
cd shared && npm install && cd ..
Create a .env
file in the server
directory:
cd server
cp .env.example .env # If example exists, or create new
Edit server/.env
with your configuration:
# Server Configuration
PORT=3000
# Database Configuration
DATABASE_URL=mongodb://localhost:27017/CertWatcher
# JWT Secrets (generate your own secure strings)
JWT_SECRET=your-super-secure-jwt-secret-here
REFRESH_TOKEN_SECRET=your-super-secure-refresh-token-secret-here
# Postmark Email Configuration
POSTMARK_API_TOKEN=your-postmark-api-token
POSTMARK_FROM_EMAIL=[email protected]
# Frontend URL for email links
FRONTEND_URL=http://localhost:5173
Option A: Local MongoDB
# Install MongoDB (macOS)
brew tap mongodb/brew
brew install mongodb-community
# Start MongoDB
brew services start mongodb-community
Option B: MongoDB Atlas (Cloud)
- Create account at MongoDB Atlas
- Create a cluster
- Get connection string and update
DATABASE_URL
in.env
You'll need AWS credentials with Route53 read access:
- Go to AWS IAM Console
- Create a new user with programmatic access
- Attach policy:
AmazonRoute53ReadOnlyAccess
- Save the Access Key ID and Secret Access Key
- Configure in the application Settings page (after starting)
- Sign up at Postmark
- Create a server
- Verify your sender email/domain
- Get your Server API Token
- Update
POSTMARK_API_TOKEN
in.env
Start both frontend and backend together:
npm start
This will start:
- Frontend on
http://localhost:5173
- Backend on
http://localhost:3000
Or run them separately:
# Terminal 1 - Frontend
cd client
npm run dev
# Terminal 2 - Backend
cd server
npm run dev
# Build frontend
cd client
npm run build
# Build backend
cd server
npm run build
# Start production server
cd server
npm start
Visit http://localhost:5173
and register a new account.
- Navigate to Settings page
- Enter your AWS credentials:
- Access Key ID
- Secret Access Key
- Region (default: us-east-1)
- Click Save Credentials
- In Settings, add email recipients for alerts
- Set alert thresholds (e.g., 30 days, 14 days, 7 days)
- Click Save Settings
- Go to Dashboard
- Click Refresh button
- Wait 20-30 minutes for initial scan to complete
- Monitor progress with the progress bar
Several test scripts are available to verify functionality:
cd server
npx tsx scripts/checkDatabase.ts
Shows current certificate count and status breakdown.
cd server
npx tsx scripts/testRoute53.ts
Verifies AWS credentials and counts available domains.
cd server
npx tsx scripts/testFullRefresh.ts
Runs a complete certificate refresh with progress tracking (takes 20-30 minutes).
cd server
npx tsx scripts/testSSL.ts
Tests SSL certificate validation for sample domains.
The main dashboard displays:
- Next Expiration: Days until the soonest certificate expiration
- Expiring in 30 Days: Count of certificates requiring attention
- Total Certificates: Total monitored deployments
- Certificate Table: Sortable list with status, domain, and expiration details
Status Indicators:
- π’ Green: More than 30 days until expiration
- π‘ Yellow: 7-30 days until expiration
- π΄ Red: Less than 7 days until expiration
AWS Credentials Section:
- Configure Route53 access
- Test connection status
Alert Settings Section:
- Manage email recipients
- Configure alert thresholds
- Send test emails
- Manually trigger alert checks
The application runs two background jobs:
- Schedule: Every hour
- Purpose: Refreshes all certificates from Route53 and checks SSL status
- Duration: ~20-30 minutes for 1,000+ domains
- Schedule: Daily at 9 AM
- Purpose: Sends email alerts for certificates reaching thresholds
- Logic: Each threshold triggers once per certificate
POST /api/auth/register
- Register new userPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logoutPOST /api/auth/refresh
- Refresh access tokenGET /api/auth/me
- Get current user
GET /api/certificates
- Get all certificatesGET /api/certificates/summary
- Get summary statisticsPOST /api/certificates/refresh
- Start background refreshGET /api/certificates/refresh/progress
- Get refresh progress
GET /api/settings
- Get application settingsPOST /api/settings/aws-credentials
- Update AWS credentialsPOST /api/settings/alerts
- Update alert settingsPOST /api/settings/test-alert
- Send test emailPOST /api/settings/check-alerts
- Manually trigger alert check
CertWatcher/
βββ client/ # React frontend
β βββ src/
β β βββ api/ # API client functions
β β βββ components/ # React components
β β βββ contexts/ # React contexts
β β βββ hooks/ # Custom hooks
β β βββ pages/ # Page components
β β βββ lib/ # Utilities
β βββ ...
βββ server/ # Express backend
β βββ config/ # Configuration files
β βββ jobs/ # Cron jobs
β βββ models/ # Mongoose models
β βββ routes/ # API routes
β βββ services/ # Business logic
β βββ scripts/ # Utility scripts
β βββ utils/ # Helper functions
βββ shared/ # Shared types/constants
βββ ...
Issue: Dashboard shows old certificate count
Solution:
- Check if refresh is still running: Look for progress indicator
- Check server logs for errors
- Verify AWS credentials in Settings
- Run diagnostic script:
npx tsx scripts/checkDatabase.ts
Issue: Not receiving alert emails
Solution:
- Verify Postmark API token in
.env
- Confirm sender email is verified in Postmark
- Check email recipients in Settings
- Use "Send Test Email" button in Settings
- Check Postmark dashboard for delivery status
Issue: Cannot fetch domains from Route53
Solution:
- Verify AWS credentials have Route53 read access
- Check IAM policy includes
route53:ListHostedZones
androute53:ListResourceRecordSets
- Test connection:
npx tsx scripts/testRoute53.ts
- Check AWS region is correct (default: us-east-1)
Issue: Cannot connect to MongoDB
Solution:
- Verify MongoDB is running:
brew services list
(macOS) - Check
DATABASE_URL
in.env
- For MongoDB Atlas, verify IP whitelist and credentials
- Test connection:
mongosh <your-connection-string>
- Large Deployments: For 1,000+ domains, initial refresh takes 20-30 minutes
- Batch Processing: SSL checks run in batches of 50 with 1-second delays
- Database Updates: Certificates updated in batches of 100
- Scheduled Jobs: Hourly refreshes ensure certificates stay current
- Background Processing: Long-running operations don't block UI
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or contributions:
- Open an issue on GitHub
- Check existing documentation in
/docs
folder - Review test scripts in
server/scripts/
- Built with shadcn/ui components
- Email delivery by Postmark
- Domain management via AWS Route53
- Developed with Pythagora
Made with β€οΈ by the CertWatcher team