A modern real-time chat application built with Next.js, TypeScript, Socket.io, MongoDB, Mongoose, Shadcn UI, Tailwind CSS, and NextAuth.js.
Buzzline enables users to create accounts, choose unique usernames, discover other users, start conversations, exchange messages instantly, and track real-time online presence with live status updates.
Frontend: https://buzzline-seven.vercel.app
Backend: Railway Deployment
- Google OAuth Authentication using NextAuth.js
- Credentials-Based Signup & Login
- JWT-Based Session Management
- Protected Routes
- Secure Password Hashing with bcrypt
- Unique Username Selection Flow
- Username Availability Validation
- One-Time Username Setup for Google Users
- Persistent User Profiles
- Search Users by Username
- Debounced Search Requests
- Instant Search Results
- One-to-One Conversations
- Instant Message Delivery using Socket.io
- Automatic Conversation Creation
- Real-Time Chat Updates
- Socket Room-Based Messaging
- Persistent Message History
- Real-Time Online Status
- Last Active Tracking
- Live Presence Updates Across Clients
- Automatic Online/Offline Detection
- Latest Message Preview in Sidebar
- Automatic Conversation Sorting
- Auto Scroll to Latest Messages
- Message Timestamps
- Responsive Chat Interface
- Clean Minimal Design
- Secure Logout Flow
- Session Persistence
- Protected Chat Access
- AMOLED Dark Theme
- Responsive Layout
- Mobile Friendly Design
- Built with Shadcn UI
- Smooth User Experience
ββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js) β
β β
β β’ Login / Signup β
β β’ Google OAuth β
β β’ Username Selection β
β β’ User Search β
β β’ Chat Interface β
β β’ Presence UI β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
β REST API
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js API Routes β
β β
β /api/register β
β /api/auth β
β /api/users β
β /api/conversations β
β /api/messages β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
β Mongoose
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β MongoDB Atlas β
β β
β Users β
β Conversations β
β Messages β
ββββββββββββββββββββββββββββββββββββββββββββββββ
WebSocket
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β Socket.io Server (3001) β
β β
β Presence Management β
β Room Management β
β Real-Time Messaging β
β β
β user-connected β
β user-online β
β user-offline β
β join-conversation β
β send-message β
β receive-message β
βββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
Conversation Rooms
β
βββββββββββββ΄ββββββββββββ
βΌ βΌ
User A User B
User A
β
β Send Message
βΌ
Next.js API Route
β
β Save Message
βΌ
MongoDB Atlas
β
β Return Saved Message
βΌ
Socket.io Server
β
β socket.to(conversationId)
βΌ
Conversation Room
β
βΌ
User B Receives Message Instantly
- Next.js
- React
- TypeScript
- Tailwind CSS
- Shadcn UI
- Next.js API Routes
- Node.js
- Socket.io
- MongoDB Atlas
- Mongoose
- NextAuth.js
- Google OAuth
- JWT
Buzzline
β
βββ src
β βββ app
β βββ components
β βββ lib
β βββ models
β βββ schemas
β βββ types
β
βββ public
β
βββ screenshots
β
βββ socket-server
β βββ server.js
β βββ User.js
β
βββ .env.local
β
βββ README.mdCreate a .env.local file in the root directory:
# MongoDB connection string from MongoDB Atlas
MONGODB_URI=your_mongodb_connection_string
# Random secret string used to sign JWT sessions (use: openssl rand -base64 32)
NEXTAUTH_SECRET=your_nextauth_secret
# Base URL of your app (use http://localhost:3000 for local dev)
NEXTAUTH_URL=http://localhost:3000
# From Google Cloud Console β APIs & Services β Credentials β OAuth 2.0 Client
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# URL where your Socket.io server is running
NEXT_PUBLIC_SOCKET_URL=http://localhost:3001
git clone https://github.com/Czar-16/BuzzLine.git
cd BuzzLinenpm installcd socket-server
npm installnpm run devApplication will be available at:
http://localhost:3000Open another terminal:
cd socket-server
node server.jsSocket server runs at:
http://localhost:3001- Built a production-style real-time chat platform using Socket.io
- Implemented conversation-based WebSocket room architecture
- Developed a real-time online presence system with last-active tracking
- Integrated Google OAuth and Credentials Authentication
- Built username-based user discovery and onboarding flow
- Designed normalized MongoDB schemas for Users, Conversations, and Messages
- Created a responsive AMOLED dark-themed user interface
- Implemented automatic conversation management and message persistence
Deploy using:
- Vercel
Deploy using:
- Railway
- MongoDB Atlas
https://buzzline-seven.vercel.app
- GitHub: https://github.com/Czar-16
- Twitter/X: https://x.com/itsCzar16
β If you found this project useful, consider giving it a star.







