Skip to content

ilgarabdullazade/spyfall-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•ต๏ธ Cษ™sus Oyunu (Spy Game)

A modern Progressive Web App (PWA) implementation of the classic Spyfall party game, built with Vue 3 and TypeScript.

๐Ÿ“ฑ Features

  • 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

๐ŸŽฎ How to Play

  1. Setup โ€” Add 3-12 players and configure game settings
  2. Deal Cards โ€” Each player secretly views their role
  3. Play โ€” Players ask each other questions about the location
  4. Find the Spy โ€” Civilians try to identify the spy before time runs out

Roles

  • Civilians โ€” Know the location, must find the spy
  • Spy โ€” Doesn't know the location, must blend in or guess it

๐Ÿ› ๏ธ Tech Stack

  • 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

๐Ÿ“ Project Structure

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

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 20+
  • pnpm 10+

Installation

# 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 dev

Available Scripts

pnpm 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 icons

โš™๏ธ Configuration

Environment Variables

Create a .env file in the root directory:

VITE_API_URL=https://your-api-url.com/api

PWA Configuration

PWA settings are configured in vite.config.ts:

  • App name and description
  • Theme colors
  • Icons and screenshots
  • Caching strategies

๐ŸŒ API

The app expects a REST API with the following endpoint:

GET /locations

Returns an array of locations:

[
  {
    "id": 1,
    "name": "Bank",
    "category": {
      "id": 1,
      "name": "Buildings"
    }
  }
]

๐Ÿ“ฆ Building for Production

# Build the app
pnpm build

# Preview the build locally
pnpm preview

The built files will be in the dist/ directory, ready for deployment to any static hosting service.

๐Ÿ”ง PWA Installation

Desktop (Chrome/Edge)

Click the install icon in the address bar or use the browser menu.

Mobile (Android)

Tap "Add to Home Screen" from the browser menu.

Mobile (iOS)

Tap the Share button โ†’ "Add to Home Screen".

๐Ÿ“„ License

MIT License โ€” feel free to use this project for your own purposes.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ž Support

If you have any questions or issues, please open an issue on GitHub.


Made with โค๏ธ in Azerbaijan

About

๐Ÿ•ต๏ธ Spyfall party game as PWA. Play offline with friends. Built with Vue 3, TypeScript, PrimeVue & Tailwind CSS.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors