Go to file
Gordon Goldbach b15a32037f Add websocket reconnection and re-authentication
Add auto reconnection and re-authentication logic to `wsClient`.

* **WebSocket Connection and Reconnection:**
  - Modify `createWSClient` to include reconnection logic.
  - Add `connect` function to handle WebSocket connection and reconnection attempts.
  - Set `reconnectAttempts` and `maxReconnectAttempts` to manage reconnection attempts.
  - Implement exponential backoff for reconnection attempts.
  - Log error when maximum reconnection attempts are reached.

* **Authentication:**
  - Add logic to re-authenticate using a token stored in `localStorage` upon WebSocket connection.
  - Set `isAuthenticated` flag based on re-authentication success.
  - Log error if re-authentication fails.

* **Error Handling:**
  - Add `onerror` event handler to log WebSocket errors and close the connection.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/MasterGordon/minesweeper/tree/v2?shareId=XXXX-XXXX-XXXX-XXXX).
2024-10-17 20:02:26 +02:00
.github/workflows added first backend draft 2024-09-19 23:50:16 +02:00
backend added bouncy image 2024-10-17 19:58:10 +02:00
public fixed login 2024-09-30 22:13:47 +02:00
shared added cases 2024-10-15 21:06:36 +02:00
src Add websocket reconnection and re-authentication 2024-10-17 20:02:26 +02:00
.gitignore removed db from git 2024-09-29 14:10:43 +02:00
README.md updated themes, added gem gain, added feed 2024-10-13 21:23:31 +02:00
bad up 2024-10-15 23:33:38 +02:00
bun.lockb added cases 2024-10-15 21:06:36 +02:00
bunfig.toml added first backend draft 2024-09-19 23:50:16 +02:00
dev.ts first layout draft 2024-09-23 00:58:36 +02:00
drizzle.config.js updated themes, added gem gain, added feed 2024-10-13 21:23:31 +02:00
eslint.config.js added match history and improved stats 2024-10-12 00:52:20 +02:00
index.html fixed login 2024-09-30 22:13:47 +02:00
package.json added cases 2024-10-15 21:06:36 +02:00
tailwind.config.js first layout draft 2024-09-23 00:58:36 +02:00
tsconfig.app.json last version before 2.0 2024-09-21 12:12:39 +02:00
tsconfig.json first commit 2024-09-14 20:30:32 +02:00
tsconfig.node.json updated math 2024-10-16 00:06:12 +02:00
vite.config.ts added cases 2024-10-15 21:06:36 +02:00

README.md

💣 Business Minesweeper

This is a version of minesweeper with a expanding board after each stage. This also includes a account system with match history, spectating live matches and collectables.

🚀 Local Development

For local development you are required to have bun installed.

# Create a .env file for token signing
echo "SECRET=SOME_RANDOM_STRING" > .env
bun install
bun run drizzle:migrate
bun dev

📦 Used Libraries

📋 Ideas

  • Add global big board
  • Questinmark after flag
  • Earn points for wins
  • Powerups