A Minesweeper game with a twist - it crashes either when you click on a mine, or when you visit at the wrong time of day! ¯\(ツ)/¯
- Classic Minesweeper: Inspired by nickarocho/minesweeper - the classic game with the classic Windows '95 look
- Dota 2 Minesweeper: Also inspired by the Dota 2 Minesweeper game
Unlike traditional Minesweeper, this game has a unique crash monitoring system:
- Click on a mine - triggers a crash event stored in Redis
- Real-time monitoring - BetterStack detects crashes via API endpoints
- Persistent crash state - crash events are stored for 5 minutes with automatic cleanup
- Test BetterStack.com Integration: Monitor API crashes and performance in real-time
- Demonstrate Redis-based State Management: Store and retrieve crash events with TTL
- Excuse to play with Terraform ¯\(ツ)/¯
- Frontend: React + TypeScript + Vite
- Infrastructure: Terraform + AWS (S3, CloudFront, API Gateway, Lambda, ElastiCache Redis)
- Monitoring: BetterStack.com (for crash detection)
- Deployment: Static site hosted on AWS S3 with CloudFront CDN
- Game: https://crashsweeper.amirdnur.dev
- API: https://api.crashsweeper.amirdnur.dev
- Status Page: https://status.amirdnur.dev/
GET https://api.crashsweeper.amirdnur.dev/minesweeper-monitor
Returns:
200- System healthy500- Crash detected (when crash events exist in Redis)
POST https://api.crashsweeper.amirdnur.dev/crash
Stores a crash event in Redis with 5-minute TTL.
The project uses Terraform to deploy:
- S3 Bucket: Static website hosting
- CloudFront: CDN with HTTPS and custom domain
- API Gateway: REST API with custom domain
- Lambda Functions:
crash-store: Stores crash events in Redisminesweeper-monitor: Checks for crash events
- ElastiCache Redis: Stores crash events with TTL
- ACM Certificate: SSL for both domains
- Clone the repository
- Install dependencies:
npm install - Run locally:
npm run dev - Deploy to AWS:
terraform apply
- Click on cells to reveal them
- Numbers show how many mines are adjacent
- Use Shift+Click to flag potential mines
- Don't click on mines... or test the monitoring system! 💥
- Add a new monitor with URL:
https://api.crashsweeper.amirdnur.dev/minesweeper-monitor - Set expected status codes: 200 (healthy) or 500 (crashed)
- Configure alert notifications for 500 responses
- View real-time status at: https://status.amirdnur.dev/
Note: This project uses BetterStack to monitor the API endpoints and display real-time status information.
- Simulate mine click:
curl -X POST https://api.crashsweeper.amirdnur.dev/crash - Check status:
curl https://api.crashsweeper.amirdnur.dev/minesweeper-monitor - Monitor in real-time: Visit https://status.amirdnur.dev/ to see live status
After building the project, deploy your static site to S3 with:
aws s3 sync ./dist s3://crashsweeper.amirdnur.dev --deleteThe game is deployed as a static website on AWS S3 using Terraform. Check out the main.tf file for the infrastructure configuration.
Built with ❤️ and a dash of chaos
