Own Your Data. Control Your Privacy. Chat Everywhere.
Live App β’ Documentation β’ Contributing β’ Architecture β’ Sponsor
Batiyoun isn't just another chat app. It's a Progressive Web Application that puts YOU in control of your data and conversations.
Unlike traditional messaging platforms where your data lives on someone else's servers forever, Batiyoun empowers users with:
- π End-to-End Encryption - Your messages are encrypted on your device before they leave
- πΎ Client-Side Storage - Store chat history, media, and files locally using IndexedDB
- π΄ Offline-First Architecture - Read your chats, view media, and compose messages even without internet
- π Your Keys, Your Data - Client-side public/private key generation and management
- π± Installable PWA - No app store approval needed. Install directly from Chrome/Edge
- π Instant Updates - No Play Store delays. Get features as soon as we ship them
- ποΈ Visual File Manager - Manage your local chat data with an intuitive interface
Note: Batiyoun is NOT blockchain-based or decentralized. It's about giving users control and transparency over their data through modern web technologies.
- β
Progressive Web App (PWA)
- Install on any device (Desktop, Mobile, Tablet)
- Native app-like experience
- Works on Windows, macOS, Linux, Android, iOS
- β
Offline Resistance
- Persistent sessions without network
- View chat history offline
- Queue messages for sending when back online
- β
Modern Authentication
- Google OAuth integration
- Email/Password with OTP verification
- Secure session management with Redis
- β
Real-Time Communication
- WebSocket-based messaging (Socket.io)
- Instant message delivery
- Typing indicators (coming soon)
- β
Automatic Updates
- Service Worker-based update system
- No app store submission delays
- Seamless background updates
- π¨ End-to-End Encryption
- ECDH key exchange
- AES-256-GCM message encryption
- Zero-knowledge architecture
- π¨ IndexedDB Storage
- Local message persistence
- Media file caching (photos, videos, documents)
- Efficient blob storage
- π¨ Visual File Manager
- Browse local chat data
- Export/Import conversations
- Manage storage quota
- π¨ Public/Private Key Management
- Client-side key generation
- Secure key storage
- Key rotation support
- πΉ Voice & Video Calls (WebRTC)
- π₯ Group Chats with role-based permissions
- π¨ Themes & Customization
- π Full-Text Search across messages
- π€ File Sharing with encryption
- π Dark Mode (system-aware)
- π Push Notifications (with encryption)
- π Multi-Language Support
Batiyoun uses a hybrid microservices architecture combining serverless scalability with stateful real-time communication.
graph TB
Client[Next.js PWA Client]
AuthAPI[Next.js API Routes]
SocketServer[Node.js WebSocket Server]
PostgreSQL[(PostgreSQL)]
MongoDB[(MongoDB)]
Redis[(Redis)]
Client -->|REST API| AuthAPI
Client -->|WebSocket| SocketServer
AuthAPI -->|Prisma ORM| PostgreSQL
SocketServer -->|Mongoose| MongoDB
AuthAPI -->|Session Cache| Redis
SocketServer -->|Pub/Sub| Redis
style Client fill:#61dafb
style AuthAPI fill:#000000
style SocketServer fill:#68a063
style PostgreSQL fill:#336791
style MongoDB fill:#4db33d
style Redis fill:#dc382d
| Component | Technology | Purpose |
|---|---|---|
| Client | Next.js 15 (App Router), React 19, TypeScript | PWA, UI, Client-side logic |
| Auth Service | Next.js API Routes, Prisma ORM | User management, Authentication |
| Auth Database | PostgreSQL (Vercel Postgres) | ACID-compliant user data |
| Realtime Server | Node.js, Express, Socket.io | WebSocket management, Message routing |
| Chat Database | MongoDB | High-write throughput for messages |
| Cache Layer | Redis | Session storage, Pub/Sub, Rate limiting |
| Shared Types | TypeScript (client/types & client/utils) | Type-safe contracts between services |
| File Storage | Cloudinary | Avatar uploads |
| Deployment | Vercel (Client + Auth), Railway (Server) | Serverless + Container hosting |
π Detailed Architecture Documentation
- Node.js v20.x or higher
- PostgreSQL database
- MongoDB cluster
- Redis instance (optional for development)
-
Clone the repository
git clone https://github.com/kushkumarkashyap7280/batiyoun.git cd batiyoun -
Install dependencies
npm install
-
Environment Configuration
Copy sample environment files:
cp client/sample.env client/.env cp server/sample.env server/.env
Update the
.envfiles with your credentials. See Environment Setup Guide for details. -
Database Setup
Run Prisma migrations for PostgreSQL:
cd client npx prisma migrate dev npx prisma generate -
Start Development Servers
From the root directory:
npm run dev
This starts:
- Client:
http://localhost:3000 - Server:
http://localhost:4000
- Client:
-
Access the App
Open http://localhost:3000 in your browser.
π Complete Setup Guide
batiyoun/
βββ client/ # Next.js PWA Application
β βββ app/ # App Router (Pages & API Routes)
β β βββ (auth)/ # Authentication pages
β β βββ (main)/ # Main app pages (chat, profile, settings)
β β βββ api/ # Next.js API endpoints
β βββ components/ # React components
β β βββ auth-components/
β β βββ landing/
β β βββ layout/
β β βββ profile/
β β βββ settings/
β β βββ ui/ # shadcn/ui components
β βββ lib/ # Utilities & clients
β β βββ prisma.ts # Prisma client
β β βββ redis.ts # Redis client
β β βββ cloudinary.ts
β βββ prisma/ # Database schema & migrations
β βββ public/ # Static assets, PWA icons, Service Worker
β βββ store/ # Zustand state management
β βββ types/ # TypeScript type definitions
β βββ utils/ # Helper functions (includes errors.ts)
β
βββ server/ # Node.js WebSocket Server
β βββ src/
β βββ config/ # Database & environment config
β βββ controllers/ # Socket event handlers
β βββ models/ # Mongoose schemas
β βββ routes/ # REST API routes
β βββ services/ # Business logic
β βββ middlewares/ # Auth, validation, error handling
β βββ utils/ # Server utilities
β
βββ docs/ # Documentation
βββ ARCHITECTURE.md
βββ CONTRIBUTING.md
βββ API.md
βββ SECURITY.md
Security is at the core of Batiyoun. We're implementing:
- π End-to-End Encryption using ECDH + AES-256-GCM
- π Client-Side Key Generation (Web Crypto API)
- π« Zero-Knowledge Architecture - Server can't read your messages
- π‘οΈ Content Security Policy (CSP)
- π HTTP-Only Cookies for session management
- β‘ Rate Limiting on all endpoints
- π Input Validation with Zod schemas
- π§ͺ Regular Security Audits
Batiyoun is open-source and community-driven. We welcome contributions of all kinds!
- π Report bugs via GitHub Issues
- π‘ Suggest features or improvements
- π Improve documentation
- π§βπ» Submit pull requests
- β Star the repository to show support
- π£οΈ Spread the word about Batiyoun
Building Batiyoun takes time, effort, and infrastructure costs. Your support helps:
- π Speed up development of new features
- π Keep the demo server running
- π Improve documentation
- π¬ Conduct security audits
- π¨ Enhance user experience
- π³ Razorpay - UPI, Cards, NetBanking (India & International)
- π° GitHub Sponsors (coming soon)
- π Open Collective (coming soon)
Be the first to sponsor Batiyoun!
- Framework: Next.js 15 (React 19, App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui (Radix UI)
- State Management: Zustand
- Forms: React Hook Form + Zod
- PWA: Workbox, Service Workers
- Runtime: Node.js
- Framework: Express
- Real-time: Socket.io
- Language: TypeScript
- User Data: PostgreSQL (Prisma ORM)
- Messages: MongoDB (Mongoose)
- Cache: Redis (Upstash)
- Files: Cloudinary
- Client Storage: IndexedDB (Dexie.js - coming soon)
- Package Manager: npm workspaces
- Build Tool: Turbo (planned)
- Linting: ESLint
- Type Checking: TypeScript
- Deployment: Vercel (Client), Railway (Server)
- Testing: Vitest (planned)
| Feature | Status | Version |
|---|---|---|
| PWA Installation | β Live | v0.1.0 |
| Google OAuth | β Live | v0.1.0 |
| Email/Password Auth | β Live | v0.1.0 |
| Offline Sessions | β Live | v0.2.0 |
| Auto-Updates | β Live | v0.2.0 |
| WebSocket Messaging | π§ Development | - |
| E2E Encryption | π§ Development | - |
| IndexedDB Storage | π Planned | - |
| File Manager | π Planned | - |
| Voice/Video Calls | π Planned | - |
This project is licensed under the MIT License - see the LICENSE file for details.
This means you can:
- β Use commercially
- β Modify
- β Distribute
- β Private use
Just include the original license and copyright notice.
- Next.js Team for the amazing framework
- Socket.io for real-time capabilities
- Prisma for the excellent ORM
- shadcn/ui for beautiful components
- Vercel for generous hosting
- All contributors who make this project better
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π§ Email: kushkumar.officialsoftwaredev@gmail.com
Built with β€οΈ by Kush Kumar
If you find Batiyoun useful, please consider giving it a β on GitHub!