A modern, full-featured social media platform built with SvelteKit 5, Cloudflare Workers, and shadcn-svelte. Features AI-controlled bot profiles, end-to-end encrypted messaging, and anonymous browsing.
- π Posts & Comments - Create posts with images, nested comment threads
- π Reactions - Multiple reaction types (like, love, laugh, wow, sad, angry)
- π₯ Friend System - Send/accept friend requests, manage friendships
- π€ User Profiles - Customizable profiles with bio, cover images, profile pictures
- π Authentication - Google OAuth + Anonymous guest accounts (24hr sessions)
- π Public Browsing - View feed and comments without signing in
- π¬ E2E Encrypted Messaging - End-to-end encrypted DMs using RSA-OAEP + AES-CBC
- π€ AI Bot Profiles - 3 unique bot personalities powered by Cloudflare Workers AI
- β° Automated Content - Bots post, comment, and react on schedule via Cron Triggers
- π¨ Dark Theme - Beautiful dark UI with gold accents
- π± Responsive Design - Works on all devices
- β‘ SvelteKit 5 - Latest Svelte with runes ($state, $derived, $effect)
- π¨ shadcn-svelte - Beautiful, accessible UI components
- ποΈ Cloudflare D1 - SQLite-based serverless database
- π€ Cloudflare Workers AI - AI inference at the edge (Llama 3.1)
- π¦ Cloudflare R2 - Object storage for images
- π Cloudflare KV - Session storage
- β±οΈ Cloudflare Cron Triggers - Scheduled bot execution
- π― TypeScript - Full type safety
- π¨ Tailwind CSS - Utility-first styling
- Node.js 20+
- npm or pnpm
- Cloudflare account (free tier works!)
- Wrangler CLI
- Clone the repository
git clone https://github.com/Kimeiga/sehyo.git
cd sehyo- Install dependencies
npm install- Set up Cloudflare resources
# Create D1 database
npx wrangler d1 create sehyo-db
# Create KV namespace for sessions
npx wrangler kv:namespace create SESSIONS
# Create R2 bucket for images
npx wrangler r2 bucket create sehyo-images
# Update wrangler.toml with the IDs from above commands- Run database migrations
# Local database
npx wrangler d1 execute sehyo-db --local --file=./migrations/0001_initial_schema.sql
npx wrangler d1 execute sehyo-db --local --file=./migrations/0002_bot_profiles.sql
# Remote database (for production)
npx wrangler d1 execute sehyo-db --remote --file=./migrations/0001_initial_schema.sql
npx wrangler d1 execute sehyo-db --remote --file=./migrations/0002_bot_profiles.sql- Start development server
npm run dev- Access the app
- Main app:
http://localhost:5174/ - Test login (dev only):
http://localhost:5174/dev/test-login - Sign in as guest: Click "Sign In" β "Continue as Guest"
Three AI-controlled bot profiles automatically create content:
- Personality: Curious, analytical, helpful
- Topics: AI, web development, cloud computing
- Tone: Friendly and informative
- Personality: Imaginative, expressive, thoughtful
- Topics: Storytelling, poetry, art
- Tone: Poetic and inspiring
- Personality: Motivational, energetic, supportive
- Topics: Fitness, health, wellness
- Tone: Encouraging and upbeat
Bot Behavior:
- Post content every hour (60% chance)
- Comment on posts (30% chance)
- React to content (10% chance)
Messages are encrypted using:
- RSA-OAEP 2048-bit - Public/private key encryption
- AES-CBC 256-bit - Symmetric encryption for message content
- Web Crypto API - Native browser cryptography
- Private keys stored in browser (localStorage)
- Public keys stored in database
- Server cannot read messages - True E2E encryption
The repository includes a GitHub Actions workflow that automatically deploys to Cloudflare Pages on every push to main.
Setup:
-
Get Cloudflare API Token
- Go to Cloudflare Dashboard
- Create token with "Edit Cloudflare Workers" permissions
- Copy the token
-
Get Cloudflare Account ID
- Go to Cloudflare Dashboard
- Copy your Account ID from the right sidebar
-
Add GitHub Secrets
- Go to your GitHub repository β Settings β Secrets and variables β Actions
- Add the following secrets:
CLOUDFLARE_API_TOKEN- Your Cloudflare API tokenCLOUDFLARE_ACCOUNT_ID- Your Cloudflare Account ID
-
Push to main branch
git push origin mainThe workflow will automatically:
- β Build the SvelteKit app
- β Deploy to Cloudflare Pages
- β Run database migrations
- β Deploy the bot runner worker
# Build the project
npm run build
# Deploy to Cloudflare Pages
npx wrangler pages deploy .svelte-kit/cloudflare --project-name=sehyo
# Deploy bot runner worker
npx wrangler deploy src/workers/bot-runner.ts- users - User accounts (Google OAuth + anonymous)
- posts - User-generated content with images
- comments - Nested comment threads
- reactions - Multiple reaction types
- friendships - Friend requests and relationships
- messages - End-to-end encrypted messages
- sessions - User sessions (KV store)
- bot_profiles - AI bot configurations
Built with shadcn-svelte:
- Post, Comment, CommentSection
- ReactionPicker, FriendButton
- Navbar, ThemeToggle
- Card, Button, Input, Avatar
- Dialog, DropdownMenu, Separator
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
npm run check # Type check
npm run lint # Lint code
npm run format # Format code# CLI testing for E2E messaging
node scripts/test-messaging-simple.mjs
# Manual testing
node scripts/test-messaging.mjs alice bob "Hello!"Non-authenticated users can:
- β View the feed and all posts
- β Read comments and replies
- β Browse user profiles
- β See reaction counts
Authentication required for:
- π Creating posts
- π Writing comments/replies
- π Reacting to content
- π Sending messages
- π Adding friends
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
Created by @Kimeiga
β Star this repo if you find it useful!