Skip to content

PrakashWebDevX/CloneAi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 CloneAI β€” AI Personality Cloner

Create a digital AI twin of your personality. Train it on your writing, chat with it in real-time, and watch it talk exactly like you.

CloneAI Banner

✨ Features

Feature Description
🎯 Personality Analysis Extracts tone, slang, sentence patterns & quirks via Claude AI
πŸ’¬ Real-Time Chat WhatsApp-style chat UI with typing indicators & auto-scroll
🎭 Personality Modes Switch between Chill 😎, Professional πŸ’Ό, and Angry 😑
🎀 Voice Input Web Speech API β€” speak to your clone hands-free
πŸ“¦ Multi-Personality Save, name, and switch between unlimited clones
πŸ“€ Export Download personality profiles as JSON
πŸš€ Streaming SSE-based streaming responses (optional)

πŸ—οΈ Tech Stack

Frontend: React 18 + Vite + Tailwind CSS + Framer Motion
Backend: Node.js + Express
AI: Anthropic Claude (claude-sonnet-4-20250514)
Database: MongoDB (optional) or in-memory fallback
Deploy: Vercel (frontend) + Render (backend)


πŸ“ Project Structure

cloneai/
β”œβ”€β”€ frontend/                  # React + Vite app
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ LandingPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TrainPage.jsx
β”‚   β”‚   β”‚   └── ChatPage.jsx
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   └── Navbar.jsx
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── PersonalityContext.jsx
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”‚   └── useVoice.js
β”‚   β”‚   └── utils/
β”‚   β”‚       └── api.js
β”‚   β”œβ”€β”€ vercel.json
β”‚   └── .env.example
β”‚
└── backend/                   # Express API
    β”œβ”€β”€ routes/
    β”‚   β”œβ”€β”€ chat.js            # Claude chat + streaming
    β”‚   β”œβ”€β”€ analyze.js         # Personality extraction
    β”‚   └── personalities.js   # CRUD + MongoDB
    β”œβ”€β”€ server.js
    β”œβ”€β”€ render.yaml
    └── .env.example

πŸš€ Quick Start (Local)

1. Clone & install

git clone https://github.com/yourusername/cloneai.git
cd cloneai

# Install backend
cd backend && npm install

# Install frontend
cd ../frontend && npm install

2. Configure environment

# Backend
cd backend
cp .env.example .env
# Edit .env β€” add your CLAUDE_API_KEY

# Frontend
cd ../frontend
cp .env.example .env
# VITE_API_URL=http://localhost:3001/api  (default, no change needed)

3. Run

# Terminal 1 β€” Backend
cd backend && npm run dev

# Terminal 2 β€” Frontend
cd frontend && npm run dev

Open http://localhost:5173 πŸŽ‰


πŸ” Environment Variables

Backend (backend/.env)

CLAUDE_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxx   # Required
MONGODB_URI=                                      # Optional (blank = in-memory)
PORT=3001
FRONTEND_URL=http://localhost:5173

Frontend (frontend/.env)

VITE_API_URL=http://localhost:3001/api

☁️ Deployment

Backend β†’ Render.com

  1. Push backend/ folder to a GitHub repo
  2. Go to render.com β†’ New Web Service
  3. Connect repo, set:
    • Build: npm install
    • Start: node server.js
  4. Add environment variables in Render dashboard:
    • CLAUDE_API_KEY = your key
    • FRONTEND_URL = your Vercel URL (set after frontend deploy)
  5. Deploy β†’ copy your Render URL (e.g. https://cloneai-api.onrender.com)

Frontend β†’ Vercel

  1. Push frontend/ to GitHub
  2. Go to vercel.com β†’ New Project β†’ Import repo
  3. Add environment variable:
    • VITE_API_URL = https://cloneai-api.onrender.com/api
  4. Deploy β†’ done!

🎀 Live Demo Guide

Setup (2 min before presenting)

  1. Open app β†’ click "Try Demo First" to load 3 prebuilt personalities
  2. Have the Train page ready with sample text pre-pasted

Demo Flow (5-7 min)

Step 1 β€” Show the landing page
"This is CloneAI β€” it creates an AI that talks exactly like a specific person."

Step 2 β€” Train a personality (live)

  • Go to Train tab
  • Paste casual sample text (from docs/demo-data.json)
  • Hit Analyze β€” show the extracted profile
  • Save it

Step 3 β€” Chat demo
Ask the clone these questions in order:

  • "Introduce yourself"
  • "What do you think about AI?"
  • "How was your day?"

Step 4 β€” Switch modes

  • Show Chill β†’ Professional β†’ Angry mode switching
  • Same question, wildly different responses

Step 5 β€” Voice input

  • Click 🎀 mic button
  • Speak a question
  • Show it transcribing and sending

Step 6 β€” Dashboard + Export

  • Show multiple personalities
  • Export one as JSON

Expected Responses

Casual Me + "How was your day?"

"bro it was kinda mid ngl lol, lowkey just vibed the whole time fr"

Work Mode + "How was your day?"

"It was quite productive, actually. Wrapped up the deliverables ahead of schedule."

Chaos Gremlin + "How was your day?"

"I am LITERALLY dead. The most unhinged sequence of events occurred today and I cannot"


πŸ› οΈ API Reference

POST /api/chat

{
  "personality": { "name": "...", "tone": "...", "traits": [], "commonWords": [], "avgSentenceLength": "..." },
  "message": "Hello!",
  "mode": "chill",
  "history": []
}

Returns: { "reply": "...", "usage": {} }

POST /api/analyze

{ "text": "your sample writing here..." }

Returns: { "profile": { "tone": "...", "traits": [], "commonWords": [], ... } }

POST /api/chat/stream

Same body as /api/chat. Returns Server-Sent Events stream.


πŸ“„ License

MIT β€” free to use, modify, and present.


Built with ❀️ using React, Express, and Claude AI.

About

🧠 CloneAI β€” AI Personality Cloner Create a digital AI twin of your personality. Train it on your writing, chat with it in real-time, and watch it talk exactly like you.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors