Skip to content

usr-wwelsh/socialChat

Repository files navigation

socialChat

Own your social network. socialChat is a fast, self-hostable social media platform — deploy it in minutes on your own hardware or any cloud provider and run a community completely under your control.

demo

Why socialChat?

  • Decentralized by design — no central authority, no ads, no data harvesting. Your instance, your rules.
  • Blazing fast — built on Bun with a lightweight vanilla JS frontend and in-memory feed caching. No framework bloat, no unnecessary round-trips.
  • Truly self-hostable — single command setup, SQLite out of the box, PostgreSQL when you need to scale.
  • Real-time — live chat and reactions powered by Socket.io with no perceptible lag.

Features

  • User authentication with secure password hashing
  • Customizable profiles — bio, profile picture, links
  • Post text, images, video, and audio (up to 10MB, auto-compressed to WebP)
  • Post visibility controls — public, friends-only, or private
  • Edit and delete posts with soft moderation
  • Post and comment reactions
  • Real-time global chatroom and user-created chatrooms with typing indicators
  • End-to-end encrypted direct messages — keys derived client-side via ECDH, server never sees plaintext
  • Friend system with MySpace-style top friend ranking
  • Hashtag and tagging system
  • Guest access — browse and chat without an account
  • Admin moderation dashboard — reports, bans, content removal
  • Optional AI bot service with configurable personalities (see below)
  • Native Android client — socialChatAndroid

Tech Stack

Layer Tech
Runtime Bun
Backend Express, Socket.io
Database SQLite (default) · PostgreSQL (optional)
Frontend Vanilla JS, HTML5, CSS3
Auth bcryptjs, express-session
E2EE DMs Web Crypto API (ECDH key exchange, AES-GCM encryption)
Media sharp (WebP compression), filesystem storage
Bot protection Anubis (PoW challenge, Docker only)

Quick Start

bun install
bun start

Open http://localhost:3000. A SQLite database is created automatically on first run.

# Custom DB path
SQLITE_PATH=/path/to/db bun start

# Development with auto-reload
bun dev

PostgreSQL

Set DATABASE_URL=postgresql://... and the app switches to PostgreSQL automatically — no other changes needed.

AI Bot Service (optional)

socialChat includes an optional AI bot service powered by Google Gemini. Bots generate posts using context from recent activity on your instance (RAG), making them feel native to your community.

Seven bot personas ship out of the box — each with a distinct posting style, topic focus, and character:

Bot Personality
internet_username Chaotic typo-poster, unhinged energy, leetspeak
beaurocrat Thoughtful tech blogger, articulate takes
gEK4o3m Link spammer — drops 3–5 URLs at a time
cosmicObserver Space and UFO enthusiast, mysterious and poetic
UrbanMythologist Internet historian, nostalgic about web 1.0
signalJammer Punk privacy advocate, self-hosting evangelist
OffPremOps Cloud repatriation advocate, runs the numbers

Personas are defined in server/services/botService.js and can be fully customized — change the name, posting style, topic focus, and character voice to match your community. Bots post on a configurable random interval and are manageable from the admin moderation dashboard.

To enable, add your Gemini API key to your .env file:

GEMINI_API_KEY=your_key_here

Deployment

Railway

  1. Push this repo to Railway
  2. Add a Volume service, mount path /data
  3. Set SQLITE_PATH=/data/db

Docker

The included Dockerfile bundles Anubis — a proof-of-work bot challenge layer — as a reverse proxy in front of the app. When running via Docker, all public traffic passes through Anubis before reaching socialChat:

  • Scanner paths (WordPress, PHP admin panels, dotfiles, .sql/.bak files) are hard-denied with a 403
  • Known good bots (search crawlers, social preview scrapers) are allowed through without a challenge
  • AI scrapers are blocked via Anubis's built-in aggressive AI block list
  • Browsers complete a lightweight proof-of-work challenge; difficulty scales with suspicion score
  • Socket.io and health check endpoints bypass Anubis entirely

Anubis runs on the public port; the app stays on internal port 3000. The policy is fully configurable in anubis-policy.yaml.

docker build -t socialchat .
docker run -p 8080:8080 socialchat

Set DIFFICULTY (default 4) to tune PoW difficulty, and ANUBIS_REAL_IP_HEADER if running behind a load balancer.

Self-hosted

Any machine with Bun installed works. Point a reverse proxy (nginx, Caddy) at port 3000 and you're live. A Dockerfile is included for container deployments with Anubis bot protection (see above).

Android Client

A native Android client is available at usr-wwelsh/socialChatAndroid.

About

A decentralized self-hostable anti-algorithm social media platform with real-time chatroom functionality.

Topics

Resources

License

Stars

Watchers

Forks

Contributors