Skip to main content
Version: 2.0.0

StoryWeaver AI

StoryWeaver AI is your creative co-pilot, helping you transform fledgling ideas into fully-formed stories. Generate unique characters, sculpt immersive worlds, and weave compelling plots with our intelligent storycrafting assistant. Built with Next.js, Tailwind CSS, shadcn/ui, and powered by Gaia's LLM API.

image

info

The complete source code and detailed instructions for setting up and running this example can be found in the Gaia Cookbook repository.

Features

  • Idea to Story: Input your core story idea, genre, desired length, and optional details like protagonist, conflict, world vibe, and tone.
  • AI-Powered Generation: Leverages a Large Language Model (via Gaia's OpenAI-compatible API) to craft unique stories.
  • Markdown Support: Displays generated stories with rich text formatting.
  • Download as Image: Save your favorite stories as PNG images.
  • Social Sharing: Quickly share links to your app (users can attach their downloaded story image) on X (Twitter), LinkedIn, and Facebook.
  • Sleek UI: Modern and responsive interface built with shadcn/ui and Tailwind CSS.

Tech Stack

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Setup & Installation

  1. Clone the repository:

    git clone https://github.com/harishkotra/story-weaver-ai.git
    cd story-weaver-ai
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Set up Environment Variables: Create a .env.local file in the root of the project. This file is ignored by Git and is used for local environment configuration.

    cp .env.example .env.local

    Now, open .env.local and add your API key:

    # .env.local

    # Required: Your API Key for the Gaia LLM service (or other OpenAI-compatible API)
    GAIA_API_KEY="your_actual_gaia_api_key_here"

    # Optional: If Gaia changes their endpoint or you use a different compatible service
    # Default is 'https://llama70b.gaia.domains/v1' if not set
    GAIA_API_ENDPOINT="https://your-custom-openai-compatible-endpoint/v1"
    GAIA_API_MODEL="llama70b"

    Important: Replace "your_actual_gaia_api_key_here" with your real API key. (Get one here)

  4. Initialize shadcn/ui (if you need to add more components): While the project is set up, if you intend to add more shadcn/ui components later, you might need to run init (though it should be configured already):

    npx shadcn@latest init

    Follow the prompts, accepting the defaults or aligning with existing project configuration (src/app/globals.css, tailwind.config.ts, aliases @/components and @/lib/utils).

Running the Application Locally

  1. Start the development server:

    npm run dev
    # or
    yarn dev
  2. Open your browser: Navigate to http://localhost:3000.

You should now see the StoryWeaver AI application running!

info

The complete source code and detailed instructions for setting up and running this example can be found in the Gaia Cookbook repository.