An open-source, privacy-first real-time messaging Progressive Web App (PWA) with password-protected rooms, QR code invitations, self-destructing file sharing, and zero accounts or logs.
Explore Features β’ Quick Start β’ PWA & Mobile β’ Architecture β’ Deployment β’ Contributing
GhostChat is designed for people who want instant, secure, and disposable group communication without creating accounts, providing phone numbers, or leaving permanent digital footprints.
Whether you need a quick temporary channel to coordinate a meeting, share sensitive credentials that expire immediately, or transfer files securely between devices without signing into third-party clouds, GhostChat creates a sandbox room in seconds and vanishes completely once everyone leaves.
- Zero Login / Zero Tracking: No email, phone number, passwords, or cookies required. Start chatting immediately.
- Auto-Assigned Identities: Dynamic, colorful identities (
Ghost_XXXX) with avatar generation. Rename anytime on the fly. - Password-Protected Rooms: Optional room passwords hashed securely with bcrypt.
- Disposable Architecture: Inactive rooms and messages are pruned automatically. Nothing is stored in permanent databases.
- Self-Destructing Files: Share files with custom expiration timers, view-once limits, and optional file-level passwords.
- Fully Installable: Add to Home Screen on iOS Safari, Android Chrome, and Desktop (Chrome / Edge / Brave).
- Interactive Install Prompts: Custom banners and step-by-step visual installation guides tailored to each operating system.
- Service Worker Caching: Intelligent cache-first caching for static assets, network-first navigation fallback, and offline awareness.
- Mobile Virtual Keyboard Optimized: Seamless input pinning above the soft keyboard using the
visualViewportAPI, preventing viewport jumping and hidden messages. - Responsive on Any Screen: Pixel-perfect support from compact screens (iPhone SE, 375Γ667) to large 4K desktop displays.
- Blazing WebSockets: Powered by Socket.IO for sub-millisecond message delivery.
- Live Typing Indicators: See who is typing in real time.
- Room QR Codes & Instant Invites: Generate dynamic QR codes for any room; scan on mobile to join protected or open rooms instantly.
- Interactive Audio Feedback: Custom sound cues for incoming and sent messages with audio permission handling and mute toggles.
- Dual Theme Support: Beautiful glassmorphism aesthetic with high-contrast Dark and Light themes.
- Recent Rooms Switcher: Fast client-side quick-switching between visited rooms with lock badges.
- Framework: React 18 + Vite
- Routing: React Router DOM v6
- Styling: Tailwind CSS + Glassmorphism tokens
- Animations: Framer Motion
- Icons: Lucide React
- QR Codes: qrcode
- Audio & Media: Web Audio API with fallback sound assets
- PWA: Service Worker API (
sw.js), Web App Manifest
- Runtime: Node.js (v18+ LTS recommended)
- Framework: Express 5
- WebSockets: Socket.IO 4.x
- Security & Cryptography: bcryptjs
- File Uploads: Multer
- Automation: node-cron for automated expired file/room sweeping
git clone https://github.com/buildwithneel/Ghostchat.git
cd Ghostchatcd backend
npm installCreate a .env file from the template:
cp .env.example .envStart the backend development server:
npm startServer runs on
http://localhost:3000
In a new terminal window:
cd frontend
npm install
npm run devClient runs on
http://localhost:5173
GhostChat complies with modern PWA criteria and provides a native-like experience across platforms:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GhostChat PWA β
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ€
β Feature β Status β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββ€
β Installable App β β
iOS, Android, Desktop β
β Service Worker (sw.js) β β
Cache-First + Fallbacks β
β Manifest (manifest.json) β β
Maskable icons & screens β
β Offline Mode β β
Cached Shell & Fallback β
β Mobile Viewport / Kbd β β
visualViewport pinned β
β Safe-Area Insets β β
env(safe-area-inset-*) β
ββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββ
-
iOS Safari: Tap
Share$\to$ Add to Home Screen. -
Android Chrome: Tap the
Installbanner or browser menu$\to$ Install app. - Desktop (Chrome/Edge): Click the install icon in the address bar.
Ghostchat/
βββ backend/
β βββ controllers/ # Room lifecycle & file management
β βββ routes/ # REST endpoints for room validation & uploads
β βββ socket/ # Real-time WebSocket connection handlers
β βββ uploads/ # Temporary file staging directory
β βββ utils/ # Password verification and hash helpers
β βββ server.js # Main HTTP + Socket.IO server & cron tasks
β βββ package.json
β
βββ frontend/
β βββ public/
β β βββ manifest.json # PWA Web App Manifest
β β βββ sw.js # Service Worker caching & routing
β β βββ icon-*.png # Maskable & standard application icons
β β βββ notification.mp3 # Audio notification cues
β βββ src/
β β βββ components/ # UI components (Chat, Modals, TopBar, PWA Banner)
β β βββ pages/ # Home & ChatRoom views
β β βββ utils/ # Colors, sound player, config resolution
β β βββ App.jsx # Theme context & route configuration
β β βββ main.jsx # Entry point & Service Worker registration
β βββ vercel.json # Vercel deployment headers & rewrite rules
β βββ vite.config.js # Vite bundler configuration
β βββ package.json
β
βββ render.yaml # Infrastructure-as-code for Render deployment
1. Backend $\to$ Render
GhostChat requires a persistent Node.js environment to maintain Socket.IO WebSocket states:
- Create a new Web Service on Render connected to this repository.
- Render detects
render.yamlautomatically. - Set the following environment variables:
PORT:3000(or Render default)CORS_ORIGIN:https://your-frontend-domain.vercel.app
- Deploy service.
2. Frontend $\to$ Vercel
- Import repository into Vercel.
- Set Root Directory to
frontend. - Add environment variables:
VITE_BACKEND_URL:https://your-render-backend-url.onrender.com
- The included
frontend/vercel.jsonautomatically configures:- SPA route rewrites to
/index.html - Cache-Control headers for
/sw.jsand/manifest.json - Static asset immutable caching
- SPA route rewrites to
- Click Deploy.
- Zero Persistence: Chat logs exist solely in volatile memory during active socket sessions.
- Cryptographic Hashing: Room passwords use standard salted bcrypt hashing.
- Access Restrictions: Rate-limiting and size thresholds on temporary file attachments.
- HTTPS Enforcement: WebSockets upgrade to WSS over TLS in production to prevent eavesdropping.
Contributions, issues, and feature requests are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: Add AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for details.
Made with π» by buildwithneel