An open API service indexing awesome lists of open source software.

https://github.com/duongdev/karakeep-social-ai

A personal bookmark manager that auto-syncs saved posts from multiple social platforms (X, Reddit, YouTube, TikTok, Dribbble, Instagram, Facebook), with AI-powered summarization, categorization, and intelligent search using Claude.
https://github.com/duongdev/karakeep-social-ai

Last synced: 5 months ago
JSON representation

A personal bookmark manager that auto-syncs saved posts from multiple social platforms (X, Reddit, YouTube, TikTok, Dribbble, Instagram, Facebook), with AI-powered summarization, categorization, and intelligent search using Claude.

Awesome Lists containing this project

README

          

# Karakeep Social AI

> ๐Ÿ”– Your AI-powered bookmark manager for social media content

Automatically sync, transcribe, summarize, and search your saved posts from multiple platforms using Claude AI and OpenAI Whisper.

[![Tests](https://img.shields.io/badge/tests-36%2F36%20passing-brightgreen)]() [![Coverage](https://img.shields.io/badge/coverage-~85%25-green)]() [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue)]() [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

---

## ๐Ÿ“‘ Table of Contents

- [Quick Start](#-quick-start)
- [Features](#-features)
- [Tech Stack](#๏ธ-tech-stack)
- [Project Status](#-project-status)
- [Documentation](#-documentation)
- [Development](#-development)
- [Testing](#-testing)
- [Deployment](#-deployment)
- [Cost Estimates](#-cost-estimates)
- [Contributing](#-contributing)
- [License](#-license)

---

## ๐Ÿš€ Quick Start

### Prerequisites

- **Node.js** 20+
- **Docker Desktop** (for PostgreSQL & Redis)
- **Git**

### Installation (5 minutes)

```bash
# 1. Clone and install
git clone https://github.com/yourusername/karakeep-social-ai.git
cd karakeep-social-ai
npm install

# 2. Start database services
docker compose up -d

# 3. Run database migrations
npm run db:migrate

# 4. Start development server
npm run dev
```

โœจ **Server running at http://localhost:3000**

๐Ÿ“– **Next steps**:
- [Quick Start Guide](guides/GETTING_STARTED.md) - Full setup
- [Platform Setup](docs/platforms/getting-started.md) - Start syncing Twitter/Reddit ๐Ÿ†•

---

## โœจ Features

### ๐Ÿ“ฑ Multi-Platform Support

**Currently Available:**
- โœ… **Twitter/X** - Bookmarks and saved tweets ([Setup Guide](docs/platforms/getting-started.md#twitterx-setup))
- โœ… **Reddit** - Saved posts and comments ([Setup Guide](docs/platforms/getting-started.md#reddit-setup))

**Coming Soon:**
- ๐Ÿšง **GitHub** - โญ Starred repositories with README content
- ๐Ÿ“‹ **YouTube** - Liked videos with full transcription
- ๐Ÿ“‹ **TikTok** - Favorite videos with transcription
- ๐Ÿ“‹ **Instagram** - Saved posts and reels with transcription
- ๐Ÿ“‹ **Dribbble** - Liked shots
- ๐Ÿ“‹ **Facebook** - Saved posts

### ๐Ÿค– AI-Powered Features

- **Auto-Summarization** - 2-3 sentence summaries of all content
- **Key Points Extraction** - Main takeaways from posts
- **Auto-Tagging** - AI-suggested tags with confidence scores
- **Smart Categorization** - Automatic assignment to lists
- **Sentiment Analysis** - Detect positive/negative/neutral tone
- **Video Transcription** - Convert videos to searchable text
- **Semantic Search** - Find content using natural language
- **Q&A System** - Ask questions about your bookmarks

### ๐ŸŽฅ Video/Audio Transcription

- **Automatic Transcription** - YouTube, TikTok, Instagram, Twitter videos
- **Powered by Whisper** - OpenAI's speech-to-text API
- **Cobalt Integration** - Fast, reliable video downloads
- **Full-Text Search** - Search within video transcripts
- **No Dependencies** - Works on Vercel serverless

---

## ๐Ÿ—๏ธ Tech Stack

### Backend
- **[Hono](https://hono.dev/)** - Fast, lightweight web framework
- **[Prisma](https://www.prisma.io/)** - Type-safe ORM with PostgreSQL
- **[Claude 3.5 Sonnet](https://www.anthropic.com/)** - AI analysis and Q&A
- **[OpenAI Whisper](https://platform.openai.com/docs/guides/speech-to-text)** - Audio transcription
- **[Cobalt API](https://github.com/imputnet/cobalt)** - Video/audio downloads
- **[BullMQ](https://docs.bullmq.io/)** - Background job processing

### Infrastructure
- **PostgreSQL 16** - Primary database
- **Redis 7** - Cache and job queue
- **Docker** - Local development environment
- **Vercel** - Serverless deployment (production)

### Testing & Quality
- **Jest** - Test framework (36/36 tests passing)
- **TypeScript** - Type safety and developer experience
- **ESLint & Prettier** - Code quality and formatting
- **GitHub Actions** - CI/CD pipeline

---

## ๐Ÿ“Š Project Status

### โœ… Phase 1: Foundation (COMPLETED)

**Week 1-2** - All core infrastructure is in place:

- โœ… TypeScript + Hono project setup
- โœ… Prisma ORM with PostgreSQL
- โœ… Complete database schema (8 tables, 2 enums)
- โœ… Docker development environment
- โœ… Health check endpoints
- โœ… Environment configuration
- โœ… **Testing infrastructure (36 tests, ~85% coverage)**
- โœ… CI/CD with GitHub Actions

**API Endpoints**:
- `GET /` - Project info
- `GET /health` - Health check + database status
- `GET /health/db` - Database connectivity
- `GET /api` - API endpoint listing

### ๐Ÿšง Phase 2: Platform Adapters (Next)

**Week 3-4** - Building platform integrations:

- [ ] Adapter architecture framework
- [ ] GitHub adapter (โญ starred repos)
- [ ] Twitter/X adapter (bookmarks)
- [ ] Reddit adapter (saved posts)

### ๐Ÿ“‹ Upcoming Phases

- **Phase 3** (Week 5) - Sync Engine
- **Phase 4** (Week 6-7) - AI Integration
- **Phase 5** (Week 8) - Search & Q&A
- **Phase 6** (Week 9) - Deployment & Monitoring

๐Ÿ“… **Full roadmap**: [docs/planning/roadmap.md](docs/planning/roadmap.md)

---

## ๐Ÿ“– Documentation

### ๐ŸŽฏ Essential Guides

| Guide | Description |
|-------|-------------|
| **[Getting Started](guides/GETTING_STARTED.md)** | Complete setup in 5 minutes |
| **[Docker Setup](guides/DOCKER.md)** | PostgreSQL + Redis configuration |
| **[Testing Guide](guides/TESTING.md)** | Writing and running tests |
| **[Setup Progress](guides/SETUP_COMPLETE.md)** | Phase 1 completion summary |
| **[Test Progress](guides/TEST_SETUP_COMPLETE.md)** | Testing infrastructure summary |

### ๐Ÿ“š Comprehensive Documentation

The `docs/` folder contains detailed documentation organized by topic:

```
docs/
โ”œโ”€โ”€ planning/ # Project planning and roadmap
โ”‚ โ”œโ”€โ”€ overview.md
โ”‚ โ”œโ”€โ”€ quick-start.md
โ”‚ โ”œโ”€โ”€ roadmap.md
โ”‚ โ””โ”€โ”€ cost-analysis.md
โ”œโ”€โ”€ architecture/ # System design and architecture
โ”‚ โ”œโ”€โ”€ system-design.md
โ”‚ โ”œโ”€โ”€ database-schema.md
โ”‚ โ””โ”€โ”€ queue-system.md
โ”œโ”€โ”€ ai/ # AI integration guides
โ”‚ โ”œโ”€โ”€ claude-setup.md
โ”‚ โ”œโ”€โ”€ features.md
โ”‚ โ”œโ”€โ”€ semantic-search.md
โ”‚ โ””โ”€โ”€ prompt-engineering.md
โ”œโ”€โ”€ transcription/ # Video transcription
โ”‚ โ”œโ”€โ”€ overview.md
โ”‚ โ”œโ”€โ”€ cobalt-setup.md
โ”‚ โ”œโ”€โ”€ whisper-setup.md
โ”‚ โ””โ”€โ”€ queue-processing.md
โ”œโ”€โ”€ platforms/ # Platform adapters
โ”‚ โ”œโ”€โ”€ adapter-architecture.md
โ”‚ โ”œโ”€โ”€ github.md
โ”‚ โ””โ”€โ”€ adding-platforms.md
โ””โ”€โ”€ deployment/ # Deployment guides
โ”œโ”€โ”€ vercel.md
โ”œโ”€โ”€ workers.md
โ”œโ”€โ”€ docker.md
โ””โ”€โ”€ environment.md
```

**Start here**: [docs/README.md](docs/README.md)

### ๐Ÿ“ Additional Files

- **[CLAUDE.md](CLAUDE.md)** - Instructions for Claude Code AI assistant
- **[LICENSE](LICENSE)** - MIT License
- **[guides/archive/](guides/archive/)** - Deprecated documentation (reference only)

---

## ๐Ÿ’ป Development

### Project Structure

```
karakeep-social-ai/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ index.ts # Main application entry
โ”‚ โ”œโ”€โ”€ lib/
โ”‚ โ”‚ โ”œโ”€โ”€ db.ts # Prisma client
โ”‚ โ”‚ โ””โ”€โ”€ env.ts # Environment config
โ”‚ โ”œโ”€โ”€ routes/
โ”‚ โ”‚ โ””โ”€โ”€ health.ts # Health check routes
โ”‚ โ”œโ”€โ”€ services/ # Business logic (coming soon)
โ”‚ โ”œโ”€โ”€ middleware/ # Custom middleware (coming soon)
โ”‚ โ”œโ”€โ”€ types/ # TypeScript types
โ”‚ โ””โ”€โ”€ __tests__/ # Test files
โ”œโ”€โ”€ prisma/
โ”‚ โ”œโ”€โ”€ schema.prisma # Database schema
โ”‚ โ””โ”€โ”€ migrations/ # Database migrations
โ”œโ”€โ”€ docs/ # Comprehensive documentation
โ”œโ”€โ”€ guides/ # Quick guides and tutorials
โ”œโ”€โ”€ .github/workflows/ # CI/CD configuration
โ””โ”€โ”€ docker-compose.yml # Docker services
```

### Available Scripts

```bash
# Development
npm run dev # Start dev server with hot reload
npm run build # Build for production
npm start # Run production build

# Database
npm run db:generate # Generate Prisma Client
npm run db:migrate # Create and run migrations
npm run db:studio # Open Prisma Studio GUI
npm run db:push # Push schema without migration
npm run db:reset # Reset database (dev only)

# Testing
npm test # Run all tests
npm run test:unit # Run unit tests
npm run test:integration # Run integration tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report

# Code Quality
npm run lint # Run ESLint
npm run format # Format code with Prettier

# Docker
docker compose up -d # Start services
docker compose down # Stop services
docker compose ps # Check status
docker compose logs -f postgres # View logs
```

### Environment Variables

The `.env` file is automatically created with Docker defaults:

```env
# Database (Docker)
DATABASE_URL=postgresql://karakeep:karakeep_dev_password@localhost:5432/karakeep_dev

# Redis (Docker)
REDIS_URL=redis://:karakeep_redis_password@localhost:6379

# Server
PORT=3000
NODE_ENV=development

# AI Services (add when ready)
ANTHROPIC_API_KEY=sk-ant-xxx # Claude AI
OPENAI_API_KEY=sk-xxx # Whisper transcription

# Platform APIs (add as needed)
GITHUB_TOKEN=ghp_xxx
TWITTER_BEARER_TOKEN=xxx
REDDIT_CLIENT_ID=xxx
REDDIT_CLIENT_SECRET=xxx
```

See [guides/DOCKER.md](guides/DOCKER.md) for Docker configuration details.

---

## ๐Ÿงช Testing

### Test Status

```
โœ… 36/36 tests passing
๐Ÿ“Š ~85% code coverage
โšก ~1.7s total runtime
```

### Test Structure

```
src/__tests__/
โ”œโ”€โ”€ setup.ts # Global test configuration
โ”œโ”€โ”€ helpers/
โ”‚ โ”œโ”€โ”€ test-db.ts # Database test utilities
โ”‚ โ””โ”€โ”€ test-server.ts # HTTP endpoint utilities
โ”œโ”€โ”€ unit/ # Unit tests (16 tests)
โ”‚ โ”œโ”€โ”€ env.test.ts # Environment config
โ”‚ โ””โ”€โ”€ db.test.ts # Database client
โ””โ”€โ”€ integration/ # Integration tests (20 tests)
โ”œโ”€โ”€ health.test.ts # API endpoints
โ””โ”€โ”€ models.test.ts # Prisma models
```

### Running Tests

```bash
# Run all tests
npm test

# Run specific test suites
npm run test:unit
npm run test:integration

# Watch mode (auto-rerun on changes)
npm run test:watch

# Generate coverage report
npm run test:coverage
```

**Full testing guide**: [guides/TESTING.md](guides/TESTING.md)

---

## ๐Ÿš€ Deployment

### Vercel (Recommended)

```bash
# Install Vercel CLI
npm i -g vercel

# Deploy
vercel --prod
```

Configure environment variables in Vercel dashboard.

### Docker

```bash
# Build image
docker build -t karakeep .

# Run container
docker run -p 3000:3000 \
-e DATABASE_URL=postgresql://... \
-e REDIS_URL=redis://... \
karakeep
```

**Deployment guides**:
- [Vercel Deployment](docs/deployment/vercel.md)
- [Docker Deployment](docs/deployment/docker.md)
- [Background Workers](docs/deployment/workers.md)

---

## ๐Ÿ’ฐ Cost Estimates

**For 100 bookmarks/month** (50 text, 30 videos, 20 GitHub repos):

| Service | Usage | Monthly Cost |
|---------|-------|--------------|
| **Vercel** | Hobby plan | $0.00 |
| **PostgreSQL** | Neon free tier | $0.00 |
| **Redis** | Upstash free tier | $0.00 |
| **Claude AI** | 100 analyses | $0.20 |
| **Whisper API** | 30 videos ร— 8 min | $2.40 |
| **Cobalt API** | Video downloads | $0.00 |
| **GitHub API** | Repository data | $0.00 |
| **Total** | | **~$2.60/mo** ๐ŸŽ‰ |

**Detailed cost analysis**: [docs/planning/cost-analysis.md](docs/planning/cost-analysis.md)

---

## ๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

1. **Fork the repository**
2. **Create a feature branch** (`git checkout -b feature/amazing-feature`)
3. **Make your changes** and add tests
4. **Run tests** (`npm test`)
5. **Commit your changes** (`git commit -m 'Add amazing feature'`)
6. **Push to branch** (`git push origin feature/amazing-feature`)
7. **Open a Pull Request**

### Development Guidelines

- Write tests for new features
- Follow TypeScript strict mode
- Use Prisma for database access
- Update documentation
- Follow existing code style
- Keep tests passing (36/36 โœ…)

---

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## ๐Ÿ™ Acknowledgments

- **[Anthropic](https://www.anthropic.com/)** - Claude AI
- **[OpenAI](https://openai.com/)** - Whisper API
- **[Cobalt](https://github.com/imputnet/cobalt)** - Video download API
- **[Prisma](https://www.prisma.io/)** - Database ORM
- **[Hono](https://hono.dev/)** - Web framework

---

## ๐Ÿ“ž Support

- ๐Ÿ“– **Documentation**: [docs/README.md](docs/README.md)
- ๐Ÿ› **Issues**: [GitHub Issues](https://github.com/yourusername/karakeep-social-ai/issues)
- ๐Ÿ’ฌ **Discussions**: [GitHub Discussions](https://github.com/yourusername/karakeep-social-ai/discussions)

---

**Built with โค๏ธ using TypeScript, Hono, Prisma, and Claude AI**

[โฌ† Back to top](#karakeep-social-ai)