feat: add user accounts, authentication, and game history with Prisma 7

- Implement user registration and login with NextAuth v5 (email/password, JWT)
- Add authentication modal in UI with login/register tabs
- Create user profile screen showing game statistics and history
- Integrate Prisma 7 ORM with SQLite database for data persistence
- Store game results (mode, path, clicks, time) in database
- Auto-save completed games only when user is authenticated
- Separate business logic into reusable hooks (useSoloGame, useMultiGame)
- Organize UI into composable screen components (HomeScreen, SoloScreen, ProfileScreen, etc)
- Add session persistence across F5 refresh for solo and multiplayer
- Style auth modal, account button, and profile stats dashboard
This commit is contained in:
jessy-david-dev
2026-04-10 15:43:07 +02:00
parent 6a75e80e6c
commit dc09658fdb
44 changed files with 12371 additions and 91 deletions
+10 -1
View File
@@ -6,20 +6,29 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
"lint": "eslint",
"postinstall": "npx node-gyp rebuild --directory node_modules/.pnpm/better-sqlite3@12.8.0/node_modules/better-sqlite3 2>/dev/null || true"
},
"dependencies": {
"@prisma/client": "^7.7.0",
"bcryptjs": "^3.0.3",
"next": "16.2.3",
"next-auth": "5.0.0-beta.30",
"react": "19.2.4",
"react-dom": "19.2.4"
},
"devDependencies": {
"@prisma/adapter-better-sqlite3": "^7.7.0",
"@tailwindcss/postcss": "^4",
"@types/bcryptjs": "^3.0.0",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"better-sqlite3": "12",
"eslint": "^9",
"eslint-config-next": "16.2.3",
"prisma": "7",
"tailwindcss": "^4",
"typescript": "^5"
}