How foyin/minesweeper2 works
Minesweeper2 is a browser Minesweeper game with optional Cognito accounts and a cloud leaderboard. A player enters through the React app, reaches the game from the home page, and plays rounds with difficulty, timer, win/loss, and scoring behavior. The game fetches and updates leaderboard entries through a configured HTTP endpoint; signed-in users can register, confirm, sign in, and sign out. The excerpts show frontend calls and Cognito operations; the README documents API Gateway and DynamoDB, but the backend flow itself is not shown.
Main entry points: App.tsx Routes · authService.ts Cognito operations · homePage.tsx Home page · minsweeper.tsx Leaderboard requests
Components 13
App and game
- React entry
src/main.tsx - Routes
src/App.tsx - Home page
src/homePage.tsx - Minesweeper game
src/Minesweeper/minsweeper.tsx
Account access
- Login and signup
src/loginPage.tsx - Account confirmation
src/confirmUserPage.tsx - Cognito operations
src/authService.ts
Leaderboard
- Score contract
src/winnerInterface.ts - Leaderboard requests
src/Minesweeper/minsweeper.tsx
Cloud services
- API Gateway endpoint
- DynamoDB
- Amazon Cognito
Other components
- Player
Connections 15
- Player → React entry: opens app
src/main.tsx - React entry → Routes: renders
src/main.tsx - Routes → Home page: routes
src/App.tsx - Routes → Login and signup: routes
src/App.tsx - Routes → Account confirmation: routes
src/App.tsx - Home page → Minesweeper game: renders
src/homePage.tsx - Player → Minesweeper game: plays
README.md - Login and signup → Cognito operations: calls
src/loginPage.tsx - Account confirmation → Cognito operations: calls
src/confirmUserPage.tsx - Home page → Cognito operations: signs out through
src/homePage.tsx - Cognito operations → Amazon Cognito: sends auth commands
src/authService.ts - Minesweeper game → Leaderboard requests: manages scores
src/Minesweeper/minsweeper.tsx - Leaderboard requests → API Gateway endpoint: gets and updates
src/Minesweeper/minsweeper.tsx - Leaderboard requests → Score contract: uses score type
src/Minesweeper/minsweeper.tsx - API Gateway endpoint → DynamoDB: persists scores