A modern Progressive Web App (PWA) implementation of the classic Spyfall party game, built with Vue 3 and TypeScript.
- Offline Support โ Play anywhere, even without internet connection
- PWA Installable โ Add to home screen for native app experience
- Mobile First โ Optimized for mobile devices
- Multilingual โ Azerbaijani language support (i18n ready)
- Dark Mode โ Toggle between light and dark themes
- Recent Players โ Remembers players for quick game setup
- Setup โ Add 3-12 players and configure game settings
- Deal Cards โ Each player secretly views their role
- Play โ Players ask each other questions about the location
- Find the Spy โ Civilians try to identify the spy before time runs out
- Civilians โ Know the location, must find the spy
- Spy โ Doesn't know the location, must blend in or guess it
- Framework: Vue 3 (Composition API)
- Language: TypeScript
- Build Tool: Vite 7
- UI Components: PrimeVue 4
- Styling: Tailwind CSS 4
- State Management: Pinia
- Data Fetching: TanStack Vue Query
- Internationalization: Vue I18n
- PWA: vite-plugin-pwa
- Offline Storage: IndexedDB (idb-keyval)
- Package Manager: pnpm
src/
โโโ assets/ # Static assets (images, fonts)
โโโ components/ # Global UI components
โ โโโ AppHeader.vue
โ โโโ AppFooter.vue
โ โโโ PWAPrompt.vue
โโโ composables/ # Global composables
โ โโโ usePWA.ts
โโโ constants/ # Global constants
โโโ i18n/ # Internationalization
โโโ layouts/ # Layout components
โ โโโ default.vue
โโโ modules/ # Feature modules
โ โโโ home/ # Home page module
โ โ โโโ components/
โ โ โโโ index.ts
โ โโโ lobby/ # Game setup module
โ โ โโโ components/
โ โ โโโ stores/
โ โ โโโ types/
โ โ โโโ index.ts
โ โโโ locations/ # Locations data module
โ โ โโโ api/
โ โ โโโ composables/
โ โ โโโ types/
โ โ โโโ index.ts
โ โโโ dealing/ # Card dealing module
โ โ โโโ components/
โ โ โโโ stores/
โ โ โโโ types/
โ โ โโโ index.ts
โ โโโ game/ # Main game module
โ โ โโโ components/
โ โ โโโ stores/
โ โ โโโ index.ts
โ โโโ rules/ # Game rules module
โ โโโ components/
โ โโโ index.ts
โโโ pages/ # Route pages
โโโ plugins/ # Vue plugins
โโโ router/ # Vue Router config
โโโ App.vue
โโโ main.ts
- Node.js 20+
- pnpm 10+
# Clone the repository
git clone https://github.com/ilgarabdullazade/spyfall-game.git
cd spyfall-game
# Install dependencies
pnpm install
# Generate PWA assets
pnpm generate-pwa-assets
# Start development server
pnpm devpnpm dev # Start development server
pnpm build # Build for production
pnpm preview # Preview production build
pnpm lint # Lint and fix files
pnpm type-check # Run TypeScript type checking
pnpm generate-pwa-assets # Generate PWA iconsCreate a .env file in the root directory:
VITE_API_URL=https://your-api-url.com/apiPWA settings are configured in vite.config.ts:
- App name and description
- Theme colors
- Icons and screenshots
- Caching strategies
The app expects a REST API with the following endpoint:
Returns an array of locations:
[
{
"id": 1,
"name": "Bank",
"category": {
"id": 1,
"name": "Buildings"
}
}
]# Build the app
pnpm build
# Preview the build locally
pnpm previewThe built files will be in the dist/ directory, ready for deployment to any static hosting service.
Click the install icon in the address bar or use the browser menu.
Tap "Add to Home Screen" from the browser menu.
Tap the Share button โ "Add to Home Screen".
MIT License โ feel free to use this project for your own purposes.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you have any questions or issues, please open an issue on GitHub.
Made with โค๏ธ in Azerbaijan