Tic Tac Toe

Tic Tac Toe Web App

This project is a web-based implementation of the classic Tic Tac Toe game built by Adedara Adeloro using FastHTML, HTMX, and Tailwind CSS.

The build steps from the original project were simplifed to use CDNs for the FastHTML Gallery version. To check out the original project, click here

Key Technologies and Techniques

  1. FastHTML: A Python-based framework for building web applications with a focus web fundamentals
  2. HTMX: HTMX is used to create the dynamic server-side content updates that lets you interact with the app without page reloads.
  3. Tailwind CSS: Tailwind classes are used throughout the HTML to style the app, providing a clean and responsive design. For example cls="grid grid-cols-3 grid-rows-3 creates a 3x3 grid for the Tic Tac Toe board.

How It Works

Server-Side Logic

The app uses FastHTML to define routes and handle game logic on the server. Key routes include:

State Management

The game state is managed server-side using global variables:

Dynamic Content

HTMX is used extensively to create a dynamic user interface