Skip to content

A backend API for a multiplayer tic-tac-toe game with user account management and live updates over websockets.

Notifications You must be signed in to change notification settings

DFMoller/xo-backend

Repository files navigation

XO Backend - Multiplayer Noughts & Crosses

A FastAPI-based multiplayer Tic-Tac-Toe game with real-time WebSocket support.

Features

  • User authentication with JWT tokens
  • Real-time gameplay using WebSockets
  • PostgreSQL or SQLite database support
  • RESTful API for game management

Development Setup

  1. Install dependencies:

    uv sync
  2. Configure environment:

    cp .env.example .env
    # Edit .env to use SQLite or PostgreSQL
  3. Run database migrations:

    alembic upgrade head
  4. Start the development server:

    uvicorn app.main:app --reload

Database Options

SQLite (Development)

DATABASE_URL=sqlite:///./xo_game.db

PostgreSQL (Production/Devcontainer)

DATABASE_URL=postgresql://postgres:postgres@db:5432/xo_game

API Documentation

Once running, visit:

About

A backend API for a multiplayer tic-tac-toe game with user account management and live updates over websockets.

Resources

Stars

Watchers

Forks