/gai-chat-rpg

Primary LanguagePythonOtherNOASSERTION

ChatRPG

🧙‍♂️ Generative Realms: AI-driven Dungeons & Dragons 🐉

You can use this service for free. Sponsorship helps ❤️

Technology Stack

Application Description

A multi-page application used as a platform for AI-assisted games of Dungeons & Dragons following the standard 5e rule set.

Pages

  • Home: Entry point of the application.
  • Game: Represents an ongoing campaign with a multimedia chat interface. The game is enhanced by dynamically generated images based on text descriptions of the setting.
  • Adventurer: A player's page, where they can manage their characters.
  • Campaigns: Displays all available campaigns. Each campaign consists of parties of characters and a Dungeon Master (DM). A player assumes the role of DM to control and moderate a campaign.
  • Admin: Accessible only to authenticated administrators. Supports user management functionalities and system configurations.

Key Features

  • Authentication: New users can signup and authenticate. Once authenticated, users gain access to the system.
  • Administrative Tools: Administrators can manage users and control system-wide settings, such as activating new chat commands.
  • Multi-Character Management: Players can create and manage multiple standard D&D characters.
  • Campaign Management: Campaigns encompassing parties of characters and a DM can be created and managed.
  • Command Interface: Chat features extensible command-based interactions. Users can perform special operations like asking rule clarifications with "/help" command.
  • Private Chat: Users can initiate private chats with one or more users. A history of chat exchanges in a conversation is maintained and accessible anytime.
  • Dynamically Generated Images: Text descriptions can generate images with a backend FastAPI service, enhancing game immersion.

Persistence

Character data, campaign details, chat histories, and other relevant state data will be persisted across users and sessions in a MongoDB database.

Future Considerations

  • A plugin system to add new chat commands.
  • Advanced game details persistence like character experiences and encounter histories.
  • An integration service that exposes a function to accept a text description and returns an image URL for UI display based on dynamically generated images.

Setup

Configuration

Create a copy of .env.template named .env and fill in the required values (e.g., OPENAI_API_KEY). Do this for both /server and /ui directories.

Dependencies

Java

Ubuntu (WSL2)

This should install Java 11.

sudo apt update
sudo apt install default-jre

Node

Use Node Version Manager to install Node.

Python

Create and activate a fresh Python virtual environment, then run:

pip install -r requirements.txt
pip install -r requirements-dev.txt

Generating the Python API Client

The latest client should always be generated and committed to the repository. However, if you need to generate a new client, ensure your server is running (see below) and run: ./gen_client.sh.

Running Locally

You can use the scripts to start each of the server (./run_srv.sh) and UI (./run_ui.sh).

Deployment

@TODO