Building an AI Text Adventure Generator Web Application: Creating Interactive Stories from Images Using Next.js, Python, and Local LLMs with Ollama Integration


Text Adventure Generator Web Application
https://github.com/kliewerdaniel/textadventure07
This is a web application that allows users to generate interactive text adventures from images. The application uses Next.js for the frontend and integrates with a Python script for generating the text adventures.
Features
- Image Upload: Upload one or more images to generate your adventure
- Customization Options: Adjust parameters like narrative style, temperature, and story length
- Interactive Results: View the generated adventure with interactive choices
Getting Started
Prerequisites
- Node.js 18.0.0 or later
- Python 3.8 or later
- Ollama (for running local AI models)
Installation
-
Clone the repository:
git clone https://github.com/kliewerdaniel/textadventure07.git cd textadventure07 -
Install Python dependencies:
pip install -r requirements.txt -
Install Node.js dependencies:
cd text-adventure-web npm install
Running the Application
-
Start the development server:
npm run dev -
Open http://localhost:3000/app in your browser to see the application.
Important: Make sure to access the
/approute to avoid hydration issues.
Deployment
This application is configured for deployment on Netlify:
-
Push your code to a GitHub repository.
-
Connect your repository to Netlify:
- Sign in to Netlify
- Click "New site from Git"
- Select your repository
- Configure build settings:
- Build command:
npm run build - Publish directory:
.next
- Build command:
-
Configure environment variables in Netlify:
- Set any required environment variables for your Python script
Project Structure
-
text-adventure-web/: Next.js web applicationsrc/app/: Application source codeapi/: API routes for handling requestsapp/: Client-side only application routecomponents/: React componentsutils/: Utility functions
public/: Static assets
-
main.py: Python script for generating text adventures -
requirements.txt: Python dependencies
How It Works
- Users upload images through the web interface
- The application sends the images to the API
- The API executes the Python script with the provided parameters
- The Python script generates a text adventure based on the images
- The results are returned to the web interface for display
Related research
Mar 29, 2026
SOVEREIGN: The Unified Architecture — A Magnum Opus for Local-First AI Systems That Think for Themselves
The capstone synthesis of every system I have built — Dynamic Persona MoE RAG, agentic knowledge graphs, Control Boundary governance, local inference stacks, and spec-driven code generation — collapsed into one unified sovereign AI architecture called SOVEREIGN. This is the project blueprint.
Jan 22, 2026
From Scaffolding to Reality: Building the Dynamic Persona MOE RAG System
Complete implementation guide transforming the theoretical dynamic persona MoE RAG system into a fully functional, end-to-end AI orchestration platform with multi-provider LLM integration, real-time visualization, and production-ready deployment.
Jan 22, 2025
Building an Advanced AI Image-to-Book Pipeline: Multimodal Storytelling with LLaVA, ChromaDB, and Recursive Narrative Generation Using Ollama
Complete technical guide to creating an AI-powered narrative generation system that transforms static images into complete books using multimodal analysis, vector databases, and recursive storytelling with LangChain and Ollama.
Jan 22, 2026
Building a Dynamic Persona-Based Mixture-of-Experts RAG System
A comprehensive guide to building a dynamic, graph-based Mixture-of-Experts Retrieval-Augmented Generation system that leverages persona-driven AI agents for contextually rich responses.
Jul 8, 2025
Complete Guide: Building Server-Side Rendered AI Applications with Next.js and Large Language Models
Build a Server Rendered AI Powered Page with Next.js + LLMs 🧠 Introduction: Build an AI Powered Web App with Next.js and LLMs In this guide, you're going to bu…
Mar 29, 2025
Building an AI-Powered Interactive Learning Platform
In this guide, we will build an interactive learning platform that leverages AI to generate dynamic lessons, quizzes, and coding challenges from user-uploaded Markdown files.