Skip to content

Latest commit

ย 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Traitdle

A daily puzzle game inspired by Wordle where players guess traits that define jobs, movies, or games.

๐ŸŽฎ How to Play

Categories

Choose from three daily categories:

  • Jobs - Guess traits a professional needs (e.g., FIREFIGHTER โ†’ brave, strong, calm)
  • Movies - Guess adjectives describing a film (e.g., INCEPTION โ†’ complex, surreal, thrilling)
  • Games - Guess adjectives describing a game (e.g., ZELDA โ†’ adventurous, magical, epic)

Game Modes

Mode How It Works
Normal (default) See 5 traits โ†’ Guess the job/movie/game. If you lose, you can try again!
๐Ÿ”ฅ EXTREME See the answer โ†’ Select the 5 correct traits from a word bank of 30 options. No retries if you lose!

Toggle EXTREME mode using the button in the header for a harder challenge!

Feedback System

  • ๐ŸŸฉ Green - Correct trait!
  • ๐ŸŸจ Yellow - Close! You guessed a synonym (try the exact word) - Normal mode only
  • โฌ› Incorrect - Not a trait for this answer

Rules

  • 5 incorrect guesses = Game Over
  • One puzzle per category per day
  • Normal mode: Win locks you out, loss lets you retry
  • EXTREME mode: Win OR loss locks you out (no retries!) - missed traits are shown at the end
  • New puzzles at midnight
  • Separate leaderboards for Normal and EXTREME modes

โœจ Features

Core Gameplay

  • Daily puzzles for 3 categories
  • Normal and Hard modes
  • Real-time trait validation with synonym support
  • Toast notifications for feedback

Statistics & Sharing

  • Track your streaks and win rate
  • Guess distribution histogram
  • Share results with emoji grid
  • Countdown timer to next puzzle
  • Separate leaderboards for Normal and EXTREME modes

Social Features

  • Daily leaderboard (ranked by fewest mistakes, then fastest time)
  • Anonymous player tracking
  • Community voting system

Polish

  • ๐ŸŒ™ Dark mode
  • ๐Ÿ”Š Sound effects (toggleable)
  • ๐ŸŽŠ Confetti celebration on wins
  • ๐Ÿ“ฑ Mobile-optimized UI
  • โ“ Tutorial for new players

๐Ÿ—ณ๏ธ Voting System

After winning a game, players help crowdsource traits for future puzzles:

  1. Each upcoming puzzle has 10-15 candidate traits
  2. Players vote: "Which trait better describes NURSE: caring or resilient?"
  3. Votes accumulate over days
  4. When the puzzle goes live, the top 5 voted traits are automatically selected

This means the community decides which traits best represent each answer!

Note: You can only vote on puzzles that are tomorrow or later (not today's puzzle).

๐Ÿ› ๏ธ Tech Stack

Layer Technology
Frontend React 18 + TypeScript + Vite
Styling Tailwind CSS
Database Supabase (PostgreSQL)
Auth Anonymous player IDs (localStorage)
Audio Web Audio API

๐Ÿ“ Project Structure

traitdle/
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ assets/         # Images (logo)
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # React components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GameBoard.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CategorySelector.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ VotingPanel.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Leaderboard.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ StatsModal.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ HelpModal.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ShareButton.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CountdownTimer.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Header.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Toast.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Confetti.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ lib/            # Services & utilities
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gameService.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ statsService.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ shareService.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ soundService.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ playerService.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ client.ts
โ”‚   โ”‚   โ”œโ”€โ”€ types.ts        # TypeScript types
โ”‚   โ”‚   โ”œโ”€โ”€ App.tsx         # Main app component
โ”‚   โ”‚   โ””โ”€โ”€ index.css       # Global styles & animations
โ”‚   โ””โ”€โ”€ package.json
โ””โ”€โ”€ database/
    โ””โ”€โ”€ schema.sql          # Complete database schema

๐Ÿš€ Setup

Prerequisites

  • Node.js 18+
  • Supabase account

1. Database Setup

  1. Create a new Supabase project
  2. Go to SQL Editor
  3. Run the contents of database/schema.sql

2. Frontend Setup

cd frontend
npm install

# Create .env.local with your Supabase credentials
echo "VITE_SUPABASE_URL=your-project-url" > .env.local
echo "VITE_SUPABASE_ANON_KEY=your-anon-key" >> .env.local

npm run dev

3. Add Puzzles

The schema includes 30 days of puzzles (May 8 - June 6, 2026) with candidate traits.

To add more puzzles:

-- Add a puzzle
INSERT INTO puzzles (date, category, answer) 
VALUES ('2026-06-07', 'jobs', 'DOCTOR');

-- Add candidate traits (10-15 per puzzle)
INSERT INTO candidate_traits (puzzle_id, word)
SELECT id, unnest(ARRAY['caring', 'intelligent', 'patient', 'skilled', 'dedicated', 'calm', 'knowledgeable', 'compassionate', 'precise', 'resilient'])
FROM puzzles WHERE answer = 'DOCTOR' AND date = '2026-06-07';

๐Ÿ“Š Database Schema

Tables

Table Purpose
puzzles Daily puzzles (date, category, answer)
traits Fixed traits for a puzzle (keyword, slot_position)
synonyms Alternative words for traits
candidate_traits Voteable traits for upcoming puzzles
trait_votes Individual votes on candidate traits
game_results Player game history
votes Legacy voting table

Key Functions

Function Purpose
get_trait_pair_for_voting() Get random trait pair from future puzzle
submit_trait_vote() Record a vote and increment count
get_puzzle_with_top_traits() Get puzzle with top 5 voted traits

๐ŸŽฏ Game Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Select Category โ”‚ (Jobs / Movies / Games)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Play Game     โ”‚ (EXTREME toggle in header)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
    โ”‚  Won?   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
    Yes  โ”‚  No
    โ–ผ    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Vote  โ”‚ โ”‚ Mode?                   โ”‚
โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚         Normal  โ”‚  EXTREME
    โ”‚            โ–ผ    โ–ผ
    โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚     โ”‚Try Again โ”‚ โ”‚ Show missed      โ”‚
    โ”‚     โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ traits, no retry โ”‚
    โ”‚          โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ–ผ          โ–ผ                โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Results (Stats, Share, Leaderboard)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Note: Winning always locks you out for the day.
      Losing in Normal mode lets you retry.
      Losing in EXTREME mode locks you out (shows missed traits).

๐Ÿ“ Adding Content

Trait Guidelines

Traits should be adjectives or qualities, not nouns or related words:

Category Good โœ… Bad โŒ
Jobs brave, patient, skilled emergency, hospital, uniform
Movies thrilling, emotional, epic action, drama, actor
Games challenging, immersive, fun controller, multiplayer, boss

Example: Adding a new job

-- 1. Create the puzzle
INSERT INTO puzzles (date, category, answer) 
VALUES ('2026-06-07', 'jobs', 'DOCTOR');

-- 2. Add 10-15 candidate traits for voting
INSERT INTO candidate_traits (puzzle_id, word)
SELECT id, unnest(ARRAY[
  'caring',
  'intelligent', 
  'patient',
  'skilled',
  'dedicated',
  'calm',
  'knowledgeable',
  'compassionate',
  'precise',
  'resilient',
  'thorough',
  'empathetic'
])
FROM puzzles WHERE answer = 'DOCTOR' AND date = '2026-06-07';

The top 5 voted traits will automatically be used when the puzzle goes live!

๐Ÿ“„ License

MIT

About

Daily puzzle where players guess 5 qualities that define a given job, movie, or game.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages