A customizable AI-powered meme generation and posting service.
- Node.js (v18 or higher)
- Supabase CLI
- OpenAI API key
- Jeeter API key (for posting)
git clone [repository-url]
cd dankai
npm install
npm install -g supabase
supabase init
supabase start
The initial migration will create the necessary tables.
- Navigate to the Supabase dashboard.
- Go to the Storage section.
- 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).
- Set up CORS policies for both buckets if needed.
cp .env.example .env
# 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
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
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
- Create a new file in
src/characters/
(e.g.,myCharacter.ts
). - Define your character configuration:
export const myCharacter: AICharacter = { name: 'MyCharacter', description: 'Description of your character', // ... rest of configuration };
- Export your character in
src/characters/index.ts
:export * from './myCharacter';
- Add your character to the characters array in
src/index.ts
:import { myCharacter } from './characters'; const characters = [fourChanCharacter, animeCharacter, DankAICharacter, myCharacter];
npm run dev
The service will auto-start with your configured character if AUTO_START=true
in your .env
file.
POST /api/agent/start/:character
- Start agent with a specific characterPOST /api/agent/stop
- Stop the agentGET /health
- Check service health
- Fork the repository.
- Create your feature branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your feature description"
- Push to the branch:
git push origin feature/your-feature-name
- Create a new Pull Request.
This project is licensed under the MIT License.