Skip to content

kushkumarkashyap7280/batiyoun

Batiyoun Logo

πŸ’¬ Batiyoun

ΰ€¬ΰ€€ΰ€Ώΰ€―ΰ₯Œΰ€‚ - The Future of Private Conversations

Own Your Data. Control Your Privacy. Chat Everywhere.

Live Demo License: MIT Status PRs Welcome

Live App β€’ Documentation β€’ Contributing β€’ Architecture β€’ Sponsor


🌟 What Makes Batiyoun Different?

Batiyoun isn't just another chat app. It's a Progressive Web Application that puts YOU in control of your data and conversations.

πŸ’‘ Core Philosophy: Data Ownership, Not Centralization

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.


✨ Features

🎯 Current Features (v0.x)

  • βœ… 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

🚧 In Development

  • πŸ”¨ 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

πŸ—ΊοΈ Roadmap

  • πŸ“Ή 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

πŸ—οΈ Architecture

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
Loading

🧩 Polyglot Persistence Pattern

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


πŸš€ Quick Start

Prerequisites

  • Node.js v20.x or higher
  • PostgreSQL database
  • MongoDB cluster
  • Redis instance (optional for development)

Installation

  1. Clone the repository

    git clone https://github.com/kushkumarkashyap7280/batiyoun.git
    cd batiyoun
  2. Install dependencies

    npm install
  3. Environment Configuration

    Copy sample environment files:

    cp client/sample.env client/.env
    cp server/sample.env server/.env

    Update the .env files with your credentials. See Environment Setup Guide for details.

  4. Database Setup

    Run Prisma migrations for PostgreSQL:

    cd client
    npx prisma migrate dev
    npx prisma generate
  5. Start Development Servers

    From the root directory:

    npm run dev

    This starts:

    • Client: http://localhost:3000
    • Server: http://localhost:4000
  6. Access the App

    Open http://localhost:3000 in your browser.

πŸ“– Complete Setup Guide


πŸ“‚ Project Structure

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

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

⚠️ Security Policy & Reporting


🀝 Contributing

Batiyoun is open-source and community-driven. We welcome contributions of all kinds!

Ways to Contribute

  • πŸ› 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

πŸ“‹ Contribution Guidelines


πŸ’– Sponsor This Project

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

Sponsor Options

Sponsor Options

Current Sponsors

Be the first to sponsor Batiyoun!


πŸ“± Technology Stack

Frontend

  • 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

Backend

  • Runtime: Node.js
  • Framework: Express
  • Real-time: Socket.io
  • Language: TypeScript

Databases & Storage

  • User Data: PostgreSQL (Prisma ORM)
  • Messages: MongoDB (Mongoose)
  • Cache: Redis (Upstash)
  • Files: Cloudinary
  • Client Storage: IndexedDB (Dexie.js - coming soon)

DevOps & Tools

  • Package Manager: npm workspaces
  • Build Tool: Turbo (planned)
  • Linting: ESLint
  • Type Checking: TypeScript
  • Deployment: Vercel (Client), Railway (Server)
  • Testing: Vitest (planned)

πŸ“Š Project Status

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 -

πŸ“„ License

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.


πŸ™ Acknowledgments

  • 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

πŸ“ž Contact & Support


🌟 Star History

Star History Chart


Built with ❀️ by Kush Kumar

If you find Batiyoun useful, please consider giving it a ⭐ on GitHub!

⬆ Back to Top

About

High-performance, E2E encrypted real-time messaging platform. Built with a hybrid architecture using Next.js (Serverless), Node.js (Stateful), PostgreSQL, MongoDB, and Redis.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors