Skip to content

simsaidev/DankAI

Repository files navigation

DankAI by SimsAI

A customizable AI-powered meme generation and posting service.

Prerequisites

  • Node.js (v18 or higher)
  • Supabase CLI
  • OpenAI API key
  • Jeeter API key (for posting)

Setup

1. Clone and Install Dependencies

git clone [repository-url]
cd dankai
npm install

2. Set Up Supabase

Install Supabase CLI if you haven’t:

npm install -g supabase

Start local Supabase:

supabase init
supabase start

The initial migration will create the necessary tables.

Create Two Storage Buckets

  1. Navigate to the Supabase dashboard.
  2. Go to the Storage section.
  3. Click "Create new bucket" and create the following buckets:
    • memes: For storing generated memes (set it to public).
    • templates: For storing meme templates (set it to public).
  4. Set up CORS policies for both buckets if needed.

3. Environment Setup

Copy the Example Environment File:

cp .env.example .env

Fill in Your Environment Variables:

# Auto Start Configuration
AUTO_START=true
AUTO_START_CHARACTER=dankai  # or your preferred character

# Supabase Configuration
SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# OpenAI Configuration
OPENAI_API_KEY=your_openai_key

# Jeeter Configuration
JEETER_API_KEY=your_jeeter_key
JEETER_AGENT=your_jeeter_agent_id
JEETER_USERNAME=your_jeeter_username

# Server Configuration
PORT=3000
NODE_ENV=development

4. Initial Migration

Create a Migration File for Supabase:

Use this schema to initialize the database:

-- Supabase Initial Migration
CREATE TABLE memes (
  id uuid DEFAULT uuid_generate_v4() NOT NULL,
  template_id text,
  top_text text,
  bottom_text text,
  prompt text,
  social_text text,
  image_path text,
  post_id text,
  created_at timestamp with time zone DEFAULT now(),
  updated_at timestamp with time zone DEFAULT now(),
  character_name text,
  template_name text,
  theme_context text,
  generation_type text,
  metadata jsonb DEFAULT '{}'::jsonb
);

CREATE TABLE templates (
  id uuid DEFAULT uuid_generate_v4() NOT NULL,
  name text,
  description text,
  image_path text,
  created_at timestamp with time zone DEFAULT now(),
  updated_at timestamp with time zone DEFAULT now()
);

Use or Save the migration file as supabase/migrations/00000000000000_initial.sql.

Run the migration:

supabase db reset

5. Character Configuration

Characters are defined in the src/characters/ directory. Each character has its own configuration file that defines:

  • Name and Description
  • LLM Settings
  • Themes and Contexts
  • Image Generation Settings
  • Posting Configuration
  • System Prompts and Rules

Add a New Character:

  1. Create a new file in src/characters/ (e.g., myCharacter.ts).
  2. Define your character configuration:
    export const myCharacter: AICharacter = {
      name: 'MyCharacter',
      description: 'Description of your character',
      // ... rest of configuration
    };
  3. Export your character in src/characters/index.ts:
    export * from './myCharacter';
  4. Add your character to the characters array in src/index.ts:
    import { myCharacter } from './characters';
    
    const characters = [fourChanCharacter, animeCharacter, DankAICharacter, myCharacter];

6. Running the Service

Start the Service:

npm run dev

The service will auto-start with your configured character if AUTO_START=true in your .env file.

API Endpoints

  • POST /api/agent/start/:character - Start agent with a specific character
  • POST /api/agent/stop - Stop the agent
  • GET /health - Check service health

Contributing

  1. Fork the repository.
  2. Create your feature branch:
    git checkout -b feature/your-feature-name
  3. Commit your changes:
    git commit -m "Add your feature description"
  4. Push to the branch:
    git push origin feature/your-feature-name
  5. Create a new Pull Request.

License

This project is licensed under the MIT License.

About

DankAI Meme Agent Creator by SimsAI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published