Migrated from Electron desktop app to Next.js web application.
- Removed Welcome Page - The app now starts directly at the home page (
/) - Removed Quit Button - No longer needed for web application
- Updated Home Page - Displays only "Create Room" and "Join Room" buttons
- Migrated All Core Infrastructure:
- Prisma database schema
- Redux store and state management
- API and Socket services
- All shared UI components
- Game styling and animations
To complete the migration, you need to create these page files by copying from the Electron project:
# Create these files in werewolf/app/
app/create-room/page.tsx # From Electron/src/renderer/pages/CreateRoomPage.tsx
app/join-room/page.tsx # From Electron/src/renderer/pages/JoinRoomPage.tsx
app/waiting-room/page.tsx # From Electron/src/renderer/pages/WaitingRoomPage.tsx
app/game/page.tsx # From Electron/src/renderer/pages/GamePage.tsxImportant: When copying, make sure to:
- Add
'use client';at the top of each file - Change
import { useNavigate } from 'react-router-dom'toimport { useRouter } from 'next/navigation' - Change
navigate(RouteEnum.X)torouter.push(RouteEnum.X) - Remove any
window.electronreferences
cd werewolf
npm install# Generate Prisma client
npm run db:generate
# Run migrations
npm run db:migrate
# (Optional) Open Prisma Studio
npm run db:studioCreate .env.local:
DATABASE_URL="postgresql://user:password@localhost:5432/werewolf"
Copy these directories from Electron/public/ to werewolf/public/:
images/(all subdirectories)sounds/(optional)
npm run devVisit http://localhost:3000
| Electron | Next.js |
|---|---|
| Welcome page with server input | Starts at home page |
| Quit button in UI | Users close browser tab |
window.electron.ipcRenderer |
Regular HTTP/WebSocket |
| Desktop only | Works on all devices |
Routes start at /welcome |
Routes start at / |
- Install dependencies:
npm install - Copy remaining page files as listed above
- Copy public assets (images)
- Setup database
- Test the application
See MIGRATION_GUIDE.md for complete details.