Skip to content

🎯 An interactive Wordle full-stack game built with Express.js, React, and Tailwind CSS, featuring smooth animations and a responsive design. The backend is powered by a serverless Express API for random-word and validity checks, complete with Swagger docs and seamless Vercel deployment.

License

Notifications You must be signed in to change notification settings

hoangsonww/The-Wordle-Game

Repository files navigation

🎮 Game Hub - Production-Ready Multi-Game Platform

A comprehensive collection of puzzle games built with React, TypeScript, and modern web technologies. This project transforms a simple Wordle clone into a full-featured gaming platform with multiple games, statistics tracking, and a polished user experience.

  • Frontend: React 19 + TypeScript + Tailwind CSS 4 + React Router
  • Backend: Express API with comprehensive endpoints for all games
  • Deployment: Production-ready monorepo deployed on Vercel
  • Games: Wordle, Connections, Sudoku, and Numbers

🎯 Live Demo

Play Now: https://the-wordle-game.vercel.app/

Vercel React TypeScript Tailwind CSS React Router Express Node.js Swagger Vite

🎮 Available Games

1. Wordle

Classic word-guessing game where you have 6 attempts to guess a 5-letter word. Each guess provides color-coded feedback.

Features:

  • 5-letter word validation via API
  • Color-coded feedback (correct, wrong position, not in word)
  • On-screen keyboard with state tracking
  • Physical keyboard support
  • Win/loss tracking with localStorage

2. Connections

Find groups of four items that share something in common. Inspired by NYT's Connections game.

Features:

  • 4 categories with varying difficulty levels
  • Color-coded difficulty (Easy, Medium, Hard, Tricky)
  • "One away" hints
  • Mistake tracking (4 mistakes max)
  • Shuffle and deselect functionality
  • Dynamic puzzle generation

3. Sudoku

Fill a 9×9 grid with digits 1-9 such that each row, column, and 3×3 box contains all digits.

Features:

  • Classic 9×9 Sudoku puzzles
  • Visual highlighting for selected cells
  • Keyboard and mouse input support
  • Real-time validation
  • Mistake tracking
  • Pre-filled cells are locked

4. Numbers

Use mathematical operations (+, -, ×, ÷) to reach a target number from a set of given numbers.

Features:

  • 6 numbers to work with
  • All four basic operations
  • Undo functionality
  • Operation history tracking
  • Division requires whole number results
  • Multiple difficulty levels

🚀 Tech Stack

Frontend

  • React 19 - Latest React with concurrent features
  • TypeScript 5.6+ - Type-safe development
  • Tailwind CSS 4 - Utility-first styling
  • React Router 6 - Client-side routing
  • Vite 6 - Lightning-fast build tool
  • Lucide React - Beautiful icon library
  • Vercel Analytics - Usage tracking

Backend

  • Node.js - JavaScript runtime
  • Express - Web application framework
  • TypeScript - Type-safe backend code
  • Undici - Fast HTTP client
  • CORS - Cross-origin resource sharing
  • OpenAPI 3.0 - API documentation standard

Production Features

  • Error Boundaries - Graceful error handling
  • Loading States - User feedback during API calls
  • Local Storage - Statistics persistence
  • Responsive Design - Mobile-first approach
  • SEO Optimized - Meta tags and semantic HTML
  • PWA Ready - Service worker and manifest

📁 Project Structure

/
├── backend/
│   ├── index.ts              # Express API + all game endpoints
│   ├── favicon.ico           # API favicon
│   ├── package.json          # Backend dependencies
│   ├── tsconfig.json         # TypeScript config
│   └── vercel.json           # Serverless deployment config
│
├── src/
│   ├── components/           # Shared components
│   │   ├── ErrorBoundary.tsx # Error handling component
│   │   ├── Layout.tsx        # Page layout with navigation
│   │   ├── GameCard.tsx      # Game selection card
│   │   └── LoadingSpinner.tsx # Loading indicator
│   │
│   ├── pages/                # Game pages
│   │   ├── Home.tsx          # Home page with game selection
│   │   ├── WordleGame.tsx    # Wordle game logic
│   │   ├── ConnectionsGame.tsx # Connections game logic
│   │   ├── SudokuGame.tsx    # Sudoku game logic
│   │   └── NumbersGame.tsx   # Numbers game logic
│   │
│   ├── (Wordle components)   # Wordle components
│   │   ├── TileRow.tsx       # Row of 5 tiles
│   │   ├── Tile.tsx          # Individual tile
│   │   ├── Keyboard.tsx      # On-screen keyboard
│   │   ├── GameWon.tsx       # Victory screen
│   │   └── GameOver.tsx      # Game over screen
│   │
│   ├── App.tsx               # Router configuration
│   └── main.tsx              # Application entry point
│
├── public/                   # Static assets
│   ├── manifest.json         # PWA manifest
│   └── (favicon files)       # App icons
│
├── package.json              # Frontend dependencies
├── vite.config.ts            # Vite configuration
├── tsconfig.json             # TypeScript config
└── README.md                 # This file

🛠️ Development

Prerequisites

  • Node.js v16+
  • npm or yarn
  • (Optional) Vercel CLI for deployment

Installation

# Clone the repository
git clone https://github.com/hoangsonww/The-Wordle-Game.git
cd The-Wordle-Game

# Install frontend dependencies
npm install

# Install backend dependencies
cd backend
npm install
cd ..

Running Locally

Frontend Development Server

# From project root
npm run dev

Opens at http://localhost:4260

Backend API Server

# From backend directory
cd backend
npm run build    # Compile TypeScript
npm start        # Start Express server

Runs at http://localhost:3001

Building for Production

# Frontend build
npm run build
# Output: dist/

# Backend build
cd backend
npm run build
# Output: backend/dist/

📖 API Documentation

Live API Docs

Endpoints

Method Path Description Response
GET /api/random-word Get random 5-letter word { "word": "apple" }
GET /api/word-valid/:word Validate word { "valid": true }
GET /api/connections/puzzle Get Connections puzzle { "groups": [...] }
GET /api/sudoku/puzzle Get Sudoku puzzle { "puzzle": [...], "solution": [...] }
GET /api/numbers/puzzle Get Numbers puzzle { "numbers": [...], "target": 347 }

Example API Calls

# Get a random word for Wordle
curl https://wordle-game-backend.vercel.app/api/random-word

# Validate a word
curl https://wordle-game-backend.vercel.app/api/word-valid/hello

# Get a Connections puzzle
curl https://wordle-game-backend.vercel.app/api/connections/puzzle

# Get a Sudoku puzzle
curl https://wordle-game-backend.vercel.app/api/sudoku/puzzle

# Get a Numbers puzzle
curl https://wordle-game-backend.vercel.app/api/numbers/puzzle

🎨 Design Features

Gradient Background Animation

All pages feature a beautiful animated gradient background that transitions smoothly between colors:

  • Pink (#ff6ec4)
  • Purple (#7873f5)
  • Green (#4ade80)
  • Yellow (#facc15)

Consistent Styling

  • Glass morphism effects (backdrop blur)
  • Rounded corners and shadows
  • Responsive design for all screen sizes
  • Accessible color contrasts
  • Smooth transitions and animations

Color Coding

  • Lime Green - Correct (Wordle) / Easy (Connections)
  • Yellow - Wrong position (Wordle) / Medium (Connections)
  • Orange - Hard difficulty (Connections)
  • Purple - Tricky difficulty (Connections)
  • Blue - Sudoku selections
  • Various - Numbers game operations

📊 Statistics Tracking

Game statistics are stored in browser localStorage:

  • Wordle wins
  • Connections puzzles solved
  • Sudoku puzzles completed
  • Numbers puzzles solved

View your stats on the home page!

🚀 Deployment

Vercel Deployment (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel --prod

The monorepo structure automatically deploys:

  • Frontend as static site
  • Backend as serverless functions

Manual Deployment

  1. Build frontend: npm run build
  2. Build backend: cd backend && npm run build
  3. Deploy dist/ to static hosting
  4. Deploy backend/ to Node.js hosting

🧪 Testing

# Run tests (if configured)
npm test

# Type checking
npm run build

# Linting
npm run lint

# Format code
npm run format

🔧 Configuration

Environment Variables

No environment variables required! The app works out of the box.

Optional:

  • PORT - Backend server port (default: 3001)

Customization

Add More Games

  1. Create game component in src/pages/
  2. Add route in src/App.tsx
  3. Add API endpoint in backend/index.ts
  4. Add game card to src/pages/Home.tsx

Change Styling

  • Modify gradient colors in Layout component
  • Update Tailwind classes in components
  • Adjust styles.css for global styles

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

💻 Author

Son Nguyen

🙏 Acknowledgments

  • Original Wordle game by Josh Wardle
  • NYT Connections for game inspiration
  • React and TypeScript communities
  • Vercel for hosting platform

🤝 Contributing

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

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

📫 Support

For issues, questions, or suggestions:


Made with ❤️ by Son Nguyen

⭐ Star this repo if you find it helpful!

About

🎯 An interactive Wordle full-stack game built with Express.js, React, and Tailwind CSS, featuring smooth animations and a responsive design. The backend is powered by a serverless Express API for random-word and validity checks, complete with Swagger docs and seamless Vercel deployment.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages