Quick Start β’ Features β’ Screenshots β’ Tech Stack β’ Contributing
Experience seamless real-time messaging with a familiar WhatsApp-like interface, powered by Appwrite's blazing-fast realtime subscriptions.
- πΌοΈ Screenshots
- β¨ Features
- π οΈ Tech Stack
- ποΈ Architecture
- π Quick Start
- βοΈ Environment Variables
- βοΈ Appwrite Setup
- π Available Scripts
- π Project Structure
- π Deployment
- πΊοΈ Roadmap
- π€ Contributing
- π License
Real-time messaging with WhatsApp-style bubbles, timestamps, and read receipts
π Login Page Clean, minimal login interface |
π Register Page Quick sign-up with validation |
| π | Secure Authentication | Email/password auth via Appwrite with protected routes |
| π¬ | Real-time Messaging | Instant message delivery using Appwrite Realtime subscriptions |
| π | Dark/Light Mode | Toggle between themes with persistent preference |
| π | Emoji Support | Full emoji picker for expressive conversations |
| π | User Search | Find and start conversations with any registered user |
| ποΈ | Message Management | Delete your own messages with permission-based controls |
| π± | Responsive Design | Seamless experience across desktop, tablet, and mobile |
| β‘ | Lightning Fast | Built with Vite for instant HMR and optimized builds |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND (React) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β AuthContext β PrivateRoutes β React Router β Tailwind CSS β
βββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β APPWRITE CLOUD β
βββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββ€
β π Accounts β ποΈ Databases β π‘ Realtime β π¦ Storage β
β β β β β
β β’ Auth β β’ users β β’ Message β β’ Media β
β β’ Sessions β β’ conversationsβ subscriptionsβ uploads β
β β β’ messages β β β
βββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββ
How it works:
- Authentication β
AuthProviderbootstraps the session viaaccount.get(). Protected routes keep chat behind login. - Data Layer β Three Appwrite collections:
users,conversations, andmessages. - Realtime β The chat room subscribes to message events and patches the UI instantly.
- UI State β React hooks manage search, layout breakpoints, emoji picker, and auto-scroll.
| Requirement | Version |
|---|---|
| Node.js | 18+ |
| npm | 10+ |
| Appwrite | Cloud or Self-hosted |
# Clone the repository
git clone https://github.com/JeetMajumdar2003/Realtime-Chat.git
# Navigate to directory
cd Realtime-Chat
# Install dependencies
npm install
# Start development server
npm run devπ Open http://localhost:5173 in your browser
Create a .env file in the root directory (use .env.sample as reference):
VITE_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
VITE_APPWRITE_PROJECT_ID=your_project_id
VITE_APPWRITE_DATABASE_ID=your_database_id
VITE_APPWRITE_COLLECTION_ID_MESSAGES=your_messages_collection_id
VITE_APPWRITE_COLLECTION_ID_CONVERSATIONS=your_conversations_collection_id
VITE_APPWRITE_COLLECTION_ID_USERS=your_users_collection_id
VITE_APPWRITE_BUCKET_ID=your_bucket_idπ Variable Reference
| Variable | Description |
|---|---|
VITE_APPWRITE_ENDPOINT |
Appwrite API endpoint URL |
VITE_APPWRITE_PROJECT_ID |
Your Appwrite project ID |
VITE_APPWRITE_DATABASE_ID |
Database ID for chat data |
VITE_APPWRITE_COLLECTION_ID_MESSAGES |
Collection storing messages |
VITE_APPWRITE_COLLECTION_ID_CONVERSATIONS |
Collection storing conversation metadata |
VITE_APPWRITE_COLLECTION_ID_USERS |
Collection storing user profiles |
VITE_APPWRITE_BUCKET_ID |
Storage bucket for media (optional) |
π Click to expand setup instructions
Create a new database in your Appwrite console (e.g., chat-db).
| Attribute | Type | Required |
|---|---|---|
username |
String | β |
email |
String | β |
β οΈ Document ID must match the Appwrite Account$id
| Attribute | Type | Required |
|---|---|---|
participants |
String[] | β |
last_message_body |
String | β |
last_message_at |
DateTime | β |
| Attribute | Type | Required |
|---|---|---|
conversation_id |
String | β |
user_id |
String | β |
username |
String | β |
body |
String | β |
- conversations: Array index on
participants - messages: Composite index on
conversation_id+$createdAt(ASC)
Enable authenticated users to create/read documents. The app uses document-level permissions for message deletion.
| Command | Description |
|---|---|
npm run dev |
π Start development server with HMR |
npm run build |
π¦ Build for production |
npm run preview |
ποΈ Preview production build locally |
npm run lint |
π Run ESLint checks |
src/
βββ π App.jsx # Router + layout shell
βββ π appwriteConfig.js # Appwrite client setup
βββ π main.jsx # App entry point
βββ π index.css # Tailwind imports
β
βββ π assets/ # Static images
β βββ chat1.png
β βββ chat2.png
β βββ login.png
β βββ register.png
β
βββ π components/
β βββ Header.jsx # Auth-aware navigation
β βββ FilePreview.jsx # File preview component
β βββ FileUploadPopup.jsx # Upload modal
β
βββ π pages/
β βββ Home.jsx # Conversation sidebar
β βββ Room.jsx # Chat room with realtime
β βββ LoginPage.jsx # Login form
β βββ RegisterPage.jsx # Registration form
β
βββ π utils/
βββ AuthContext.jsx # Auth state management
βββ PrivateRoutes.jsx # Route protection
# Build and deploy
npm run build
npx appwrite deploy sites create --projectId=your_project_id --siteId=your_site_id --path=./dist --entrypoint=index.html- Update
homepageinpackage.jsonif forking - Add your deployed domain to Appwrite Project Settings β Platforms
- π₯ Group chats & read receipts
- π File & voice note uploads
- π Push notifications via Appwrite Functions
- π Message reactions & typing indicators
- β¨ Onboarding animations
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
Made with β€οΈ by Jeet Majumdar

