What you’ll build
A complete chat application featuring:- Real-time messaging with delivery status indicators (sent, delivered, read)
- Chat list management with unread counts, search, and pinned conversations
- Media sharing with drag-and-drop image uploads and previews
- Message status system tracking message lifecycle from queued to read
- Contact management with online presence and last seen timestamps
- Typing indicators showing when contacts are composing messages
- Draft message persistence automatically saving unfinished messages
- Responsive design optimized for mobile, tablet, and desktop
- WhatsApp-like UI with custom theming and smooth animations
Key features
Real-time messaging
Send and receive messages with instant delivery status updates using Zustand state management and automated message lifecycle simulation.
Media sharing
Share images with drag-and-drop upload, preview thumbnails, and caption support. Built with react-dropzone for seamless file handling.
Smart search
Search conversations by contact name or message content with search history that persists across sessions.
Status indicators
Track message delivery with visual status icons: queued, sending, sent, delivered, and read with color-coded feedback.
Typing awareness
See when contacts are typing with animated indicators that automatically timeout after periods of inactivity.
Draft persistence
Never lose your messages – drafts are automatically saved to localStorage and restored when you return to a conversation.
Tech stack
This application is built with modern web technologies:- Next.js 15 with App Router and React Server Components
- React 19 with hooks for state management
- Zustand for predictable state management with persistence
- TypeScript for type safety and better developer experience
- Tailwind CSS v4 with custom theming and animations
- Radix UI for accessible, unstyled component primitives
- Phosphor Icons for the complete icon set
- date-fns for date formatting and relative timestamps
Architecture overview
The application follows a component-based architecture:Get started
Quickstart
Get the chat app running in 5 minutes with our step-by-step guide
Installation
Detailed installation instructions for npm, yarn, or pnpm
Core concepts
State management
The application uses Zustand for centralized state management with localStorage persistence. All chat data, messages, contacts, and drafts are stored in a single store:Message lifecycle
Messages progress through multiple states automatically:- queued – Message created locally
- sending – Upload in progress
- sent – Delivered to server
- delivered – Received by recipient
- read – Viewed by recipient
lib/chat/state.ts with automated transitions:
Responsive layout
The chat interface adapts to screen size:- Mobile: Single-column view with navigation between chat list and conversation
- Tablet/Desktop: Side-by-side layout with persistent chat list sidebar
useIsMobile hook.