Generate a complete, ready-to-play AI-powered character sheet for your tabletop RPG campaigns. Simply provide a few core concepts, and let AI build the rest!
React | TypeScript | Google Gemini
- ๐ค Full AI-Powered Generation - Uses Google's Gemini 2.5 Flash for rich backstories and creative item names, and Imagen 3.0 for high-quality character portraits and atmospheric backgrounds.
- ๐ Limitless RPG Settings - The AI adapts to any setting you can imagine, from classic fantasy to grimdark sci-fi.
- ๐ Customizable Characters - Define your character's name, race, alignment (inclination), and RPG setting.
- ๐ฒ Randomized Stat Distribution - Automatically distributes points across main, secondary, and unique AI-generated extra skills.
- ๐ AI-Generated History & Items - Creates a unique backstory, a custom weapon, and a defensive item tailored to your character's profile.
- ๐จ Dynamic Theming - The app's entire color scheme changes based on the RPG setting (e.g., horror, fantasy) for a more immersive experience.
- ๐ Multilingual Support - Fully available in English (US) and Portuguese (BR), including AI-generated content.
- ๐พ Downloadable Sheets - Export your final character sheet as a high-quality JPG or PDF.
- ๐ฑ Responsive Design - Works seamlessly on desktop and mobile devices.
Unlike generators with predefined universes, this application allows you to enter any RPG setting in a text field. The AI will intelligently adapt the character's description, skills, items, and artistic style to match your input.
Some examples include:
Medieval FantasyCyberpunk DystopiaPost-Apocalyptic WastelandVampire Horror in the 19th CenturySpace Opera with Alien RacesLovecraftian Cosmic Horror
- A modern web browser.
- Google Gemini API Key (Get one from Google AI Studio)
This project is set up as a client-side application and does not require a complex build process.
-
Clone the repository
git clone https://github.com/your-username/ai-rpg-character-sheet.git cd ai-rpg-character-sheet -
Set up the API Key The application is designed to be deployed in an environment where the
API_KEYis securely set. To run it locally, you can create a simple bootstrap file.Create a file named
dev-runner.htmland paste the following, replacingyour_actual_api_key_herewith your key:<!DOCTYPE html> <html> <head> <title>Dev Runner</title> <script> // WARNING: For local development only. Do not commit your API key. // This simulates setting an environment variable before the app loads. window.process = { env: { API_KEY: 'your_actual_api_key_here' } }; </script> </head> <body> <p>Loading application...</p> <script> // Redirect to the main application file window.location.href = './index.html'; </script> </body> </html>
-
Start a local server You need a simple HTTP server to handle module imports correctly. If you have Node.js, you can use
serve:# Install serve globally if you don't have it npm install -g serve # Run the server serve .
-
Open your browser Navigate to the local server address and open
dev-runner.html. This will set the key and then load the application.
ai-rpg-character-sheet/
โโโ components/ # Reusable React components
โ โโโ CharacterForm.tsx
โ โโโ CharacterSheet.tsx
โ โโโ LanguageSwitcher.tsx
โ โโโ Spinner.tsx
โ โโโ StatBlock.tsx
โโโ context/ # React Context providers
โ โโโ i18n.tsx
โโโ locales/ # Translation files
โ โโโ translations.ts
โโโ services/ # API services
โ โโโ geminiService.ts # Gemini & Imagen API integration
โโโ utils/ # Utility functions
โ โโโ distribution.ts
โโโ App.tsx # Main application component
โโโ constants.ts # Application constants (skills, etc.)
โโโ types.ts # TypeScript type definitions
โโโ index.html # Main HTML entry point
โโโ index.tsx # Application entry point
โโโ metadata.json # Application metadata
โโโ README.md # This file
- User Input: The user fills out a simple form with the character's name, race, alignment, and RPG setting.
- AI Generation: On submission, the app makes parallel calls to the Google Gemini API:
gemini-2.5-flashis prompted to generate a JSON array of extra skills, a unique weapon name, and a shield name, all based on the setting.- After stats are rolled,
gemini-2.5-flashis prompted again to write a detailed character history, weaving together all the known attributes. imagen-3.0-generate-002is prompted twice: once to generate the character's portrait and once to create an atmospheric background landscape matching the setting.
- Sheet Assembly: The React front-end combines the user's input, the randomly distributed stats, and all the AI-generated content into a single data object.
- Dynamic Display: The character sheet is rendered with the appropriate theme (e.g., sepia filter for fantasy, red/black for horror), and the long history text is made collapsible with a "Read more" button.
- Modify Skills: Add, remove, or change the main and secondary skills directly in the
constants.tsfile. The point distribution logic will adapt automatically. - Tweak AI Prompts: Adjust the prompts sent to Gemini by editing the strings in
locales/translations.ts. This allows you to change the tone, length, or style of the AI-generated content. - Adjust Theming: The logic for applying themes based on setting keywords is located in
App.tsx. You can add new keywords or create entirely new themes.
Contributions are welcome! Please feel free to fork the repository, create a feature branch, and open a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini for the powerful generative AI capabilities.
- React and Tailwind CSS for the modern development framework and styling.
- The global TTRPG community for being a constant source of inspiration.
Made with โค๏ธ for Game Masters and Players everywhere.
