Skip to content

codekshitij/BlueChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”΅ BlueChat - Ephemeral Time-Boxed Chat Platform

A modern, real-time chat web application featuring ephemeral time-boxed rooms and multi-threaded conversations. Built with React, TypeScript, Vite, and Firebase.

Status: 🚧 In Active Development | Version: 1.0.0-alpha

✨ Unique Features

🌟 What Makes BlueChat Different

  • ⏰ Ephemeral Rooms - All chat rooms automatically delete after 1hr, 4hr, 8hr, or 24hr
  • 🧡 Multi-Threading - Click any message to start a focused sub-conversation
  • πŸ“… Scheduled Rooms - Create rooms that start at a specific future time (perfect for events)
  • πŸ’Ύ Archive Mode - Save conversation highlights before the room expires
  • ⚑ Real-Time Everything - Live countdowns, instant messaging, typing indicators

πŸ’‘ Why This Combination is Unique

No other chat application combines ephemeral messaging with multi-threaded conversations. BlueChat creates urgency (rooms disappear!) while keeping discussions organized (threads reduce clutter).

Perfect For:

  • Study groups that don't need permanent history
  • Event-based discussions (conferences, meetups)
  • Privacy-conscious conversations
  • Temporary team collaborations
  • Focus groups and brainstorming sessions

πŸš€ Quick Start

Prerequisites

  • Node.js >= 20.0.0
  • pnpm >= 9.0.0

Installation

# Clone the repository
git clone <your-repo-url>
cd BlueChat

# Install dependencies
pnpm install

# Start the development server
pnpm dev

Access the App

πŸ—οΈ Architecture

Monorepo Structure

BlueChat/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ client/          # React frontend (Vite + TypeScript + Tailwind)
β”‚   └── server/          # Node.js backend (Express + Socket.IO + TypeScript)
β”œβ”€β”€ docs/                # Documentation
β”œβ”€β”€ pnpm-workspace.yaml  # Workspace configuration
└── package.json         # Root package scripts

Tech Stack

Frontend

  • React 18 - UI library
  • TypeScript - Type safety
  • Vite - Fast dev server and build tool
  • Tailwind CSS - Utility-first CSS framework
  • Socket.IO Client - WebSocket client
  • Zustand - State management
  • React Router - Client-side routing
  • Axios - HTTP client

Backend

  • Node.js + Express - Server framework
  • TypeScript - Type safety
  • Socket.IO - Real-time bi-directional communication
  • Prisma - Database ORM (PostgreSQL)
  • Bull - Job queue for timed room deletions
  • Redis - Caching and job queue
  • JWT - Authentication
  • Helmet - Security middleware

DevOps

  • Docker - Containerization
  • GitHub Actions - CI/CD
  • Railway/Render - Hosting (planned)

πŸ“‹ Available Commands

# Development
pnpm dev              # Start both client and server
pnpm dev:client       # Start only frontend
pnpm dev:server       # Start only backend

# Building
pnpm build            # Build both packages
pnpm build:client     # Build frontend
pnpm build:server     # Build backend

# Type checking
pnpm type-check       # Check types in all packages

# Cleaning
pnpm clean            # Remove all node_modules and dist folders

🎯 Current Development Status

βœ… Completed

  • Monorepo setup with pnpm workspaces
  • Frontend React app with Vite
  • Backend Express server with TypeScript
  • WebSocket server with Socket.IO
  • Basic UI with Tailwind CSS
  • Development environment configured

🚧 In Progress

  • Database schema with Prisma
  • Authentication system (JWT + Guest mode)
  • Room CRUD operations
  • Timer/expiration with Bull queues

πŸ“… Planned

  • Multi-threaded conversations
  • Real-time messaging
  • Scheduled rooms
  • Archive/highlights feature
  • Production deployment
  • Comprehensive testing

πŸ”§ Development

Project Structure

Client (packages/client/)

src/
β”œβ”€β”€ components/       # Reusable UI components
β”‚   β”œβ”€β”€ chat/        # Chat-related components
β”‚   β”œβ”€β”€ rooms/       # Room management components
β”‚   β”œβ”€β”€ threads/     # Threading components
β”‚   └── ui/          # Base UI components
β”œβ”€β”€ hooks/           # Custom React hooks
β”œβ”€β”€ store/           # Zustand state management
β”œβ”€β”€ services/        # API and WebSocket services
β”œβ”€β”€ pages/           # Route pages
β”œβ”€β”€ types/           # TypeScript definitions
└── utils/           # Utility functions

Server (packages/server/)

src/
β”œβ”€β”€ controllers/     # Route controllers
β”œβ”€β”€ services/        # Business logic
β”œβ”€β”€ models/          # Database models (Prisma)
β”œβ”€β”€ socket/          # WebSocket event handlers
β”œβ”€β”€ middleware/      # Express middleware
β”œβ”€β”€ routes/          # API routes
β”œβ”€β”€ jobs/            # Background jobs (Bull)
β”œβ”€β”€ config/          # Configuration
β”œβ”€β”€ types/           # TypeScript definitions
└── utils/           # Utility functions

Environment Variables

Copy .env.example to .env in the server package and configure:

PORT=5001
NODE_ENV=development
CLIENT_URL=http://localhost:3000
JWT_SECRET=your-secret-key
DATABASE_URL=postgresql://...
REDIS_URL=redis://...

πŸ“š Documentation

🎨 Design System

Color Palette (Warm Earthy Theme)

  • Light Background: #FEFAE0 - Warm cream
  • Dark Background: #283618 - Deep olive green
  • Primary: #606C38 - Olive green
  • Secondary: #DDA15E - Warm golden
  • Accent: #BC6C25 - Golden brown

Key UI Components

  • Room cards with live countdown timers
  • Message bubbles (self vs others)
  • Thread sidebar/panel
  • Archive modal
  • Scheduled room cards
  • Online user indicators

🀝 Contributing

This is currently a portfolio/resume project, but contributions and suggestions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is for portfolio/educational purposes.

πŸ™ Acknowledgments

  • Inspired by the ephemeral nature of Snapchat and Clubhouse
  • Threading concept from Discord and Slack
  • Privacy-first approach

πŸ“ž Contact

Developer: Kshitij Mishra
Project: BlueChat - Full-Stack Chat Application
Purpose: Portfolio/Resume Project


Built with ❀️ using TypeScript, React, and Node.js

πŸš€ Features

Core Functionality

  • True Proximity-Based: Messages sent directly via Bluetooth to nearby devices
  • Local Storage: All data stored locally on device until leaving chat
  • No Internet Required: Works completely offline via Bluetooth mesh network
  • Privacy-First: No external servers, no data leaves your device
  • Real-time Messaging: Instant communication with nearby users
  • Automatic Cleanup: Messages cleared when leaving chat for privacy

Technical Features

  • Bluetooth Mesh Network: Direct device-to-device communication
  • TypeScript: Full type safety throughout the app
  • Zustand State Management: Clean, predictable state management
  • Expo Router: File-based navigation with dynamic routes
  • AsyncStorage: Local data persistence
  • Responsive Design: Works on iOS, Android, and Web

πŸ—οΈ Architecture

True Proximity-Based Approach

User A sends message β†’ Bluetooth broadcast β†’ All nearby users receive
                ↓
            Local Storage β†’ Messages persist until leaving chat

Project Structure

BlueChat/
β”œβ”€β”€ app/                    # Expo Router screens
β”‚   β”œβ”€β”€ index.tsx          # Username entry screen
β”‚   β”œβ”€β”€ rooms.tsx          # Available rooms & nearby users
β”‚   └── chat/[roomId].tsx  # Chat room screen
β”œβ”€β”€ components/            # Reusable UI components
β”‚   β”œβ”€β”€ ui/               # Base components (Button, Input, etc.)
β”‚   └── rooms/            # Room-specific components
β”œβ”€β”€ store/                # Zustand state management
β”œβ”€β”€ services/             # Bluetooth service & business logic
β”œβ”€β”€ types/                # TypeScript type definitions
└── utils/                # Helper functions & local storage

Data Flow

  1. User Entry β†’ Create user β†’ Initialize Bluetooth node
  2. Room Discovery β†’ Scan for nearby Bluetooth devices β†’ Display available rooms
  3. Join Room β†’ Connect to host device via Bluetooth mesh
  4. Send Message β†’ Broadcast via Bluetooth to all room members
  5. Receive Messages β†’ Get messages from other devices via Bluetooth
  6. Local Storage β†’ Messages stored locally until leaving chat

🎨 Design System

Color Palette (Warm Earthy Theme)

  • Light Background: #FEFAE0
  • Dark Background: #283618
  • Primary: #606C38
  • Secondary: #DDA15E
  • Accent: #BC6C25
  • White: #FFFFFF
  • Gray Light: #F3F4F6
  • Gray Medium: #9CA3AF
  • Gray Dark: #374151

Typography

  • Headline: 32px, bold
  • Title: 20px, bold
  • Body: 16px, regular
  • Caption: 14px, regular
  • Small: 12px, regular

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • Expo CLI
  • iOS Simulator / Android Emulator / Web Browser

Installation

# Clone the repository
git clone <repository-url>
cd BlueChat

# Install dependencies
npm install

# Start the development server
npm start

Running the App

  1. iOS: Press i in the terminal or scan QR code with Expo Go
  2. Android: Press a in the terminal or scan QR code with Expo Go
  3. Web: Press w in the terminal to open in browser

πŸ“± User Flow

1. Username Entry

  • Enter a username (2-20 characters, alphanumeric + underscore)
  • Validation ensures proper format
  • Creates user profile and initializes Bluetooth node

2. Room Discovery

  • Automatically scans for nearby Bluetooth devices
  • Displays available chat rooms from nearby hosts
  • Shows room capacity and member count
  • Join rooms that aren't full

3. Chat Room

  • Real-time messaging with other nearby users
  • Messages sent directly via Bluetooth
  • Message history loaded from local storage
  • Leave room functionality with automatic cleanup

πŸ”§ Bluetooth Service

The app includes a comprehensive Bluetooth service that simulates:

  • Bluetooth Mesh Network: Direct device-to-device connections
  • Proximity Discovery: Find nearby users via Bluetooth scanning
  • Room Management: Create, join, and leave rooms via Bluetooth
  • Message Broadcasting: Send messages to all room members
  • Local Storage: Persist messages locally until leaving

πŸ› οΈ Development

Key Technologies

  • React Native: Cross-platform mobile development
  • Expo: Development platform and tools
  • TypeScript: Type-safe JavaScript
  • Zustand: Lightweight state management
  • Expo Router: File-based navigation
  • AsyncStorage: Local data persistence

Code Quality

  • TypeScript: Strict type checking enabled
  • ESLint: Code linting and formatting
  • Component Architecture: Reusable, modular components
  • Error Handling: Comprehensive error boundaries and user feedback

🎯 Next Steps

Potential Enhancements

  • Real Bluetooth Integration: Replace simulation with actual Bluetooth API
  • Push Notifications: Notify users of new messages
  • User Profiles: Add avatars and user preferences
  • Room Creation: Allow users to create new rooms
  • Message Reactions: Add emoji reactions to messages
  • File Sharing: Share images and files via Bluetooth

Performance Optimizations

  • Message Pagination: Load messages in chunks
  • Image Optimization: Compress and cache images
  • Offline Support: Enhanced offline capabilities
  • Background Sync: Sync messages when app becomes active

πŸ“„ License

This project is for portfolio/demo purposes. Feel free to use as a reference for your own projects.


Note: This is a demo application that simulates Bluetooth functionality. For production use, you would need to implement actual Bluetooth discovery and mesh networking using the appropriate platform APIs.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published