A full-stack, real-time chat application built with a modern technology stack. This project features user authentication, chat rooms, direct messaging, typing indicators, and a persistent message history.
Live Demo:
- Frontend (Client): [Your Vercel App URL Here]
- Backend API: [Your Render App URL Here]
- Secure User Authentication: Register and Login with JWT.
- Password Recovery: "Forgot Password" flow with email verification. -- Chat Rooms: Users can create and join public chat rooms.
- Direct Messaging: Users can have private one-on-one conversations.
- Real-time Experience: Features like "online users list" and "typing indicators".
- Persistent History: Messages are saved to a PostgreSQL database.
- Professional Architecture: Built with a monorepo structure and a clean separation of concerns (Routes, Controllers, Services).
- Frontend: Next.js, React, TypeScript, Tailwind CSS, Socket.io-client, Axios
- Backend: Node.js, Express.js, TypeScript, Socket.io
- Database: PostgreSQL + Prisma (ORM)
- Validation: Zod
- Deployment: Vercel (Client), Render (Server & DB)
To run this project locally, follow these steps:
-
Clone the repository
git clone [Your GitHub Repo URL] cd real-time-chat-app -
Install dependencies from the root
npm install
-
Set up environment variables
- Create a
.envfile inside theserverdirectory. - Add your
DATABASE_URL,JWT_SECRET, andRESEND_API_KEY.
- Create a
-
Run database migrations and seed
# Go to the server directory to run prisma commands cd server npx prisma migrate dev npx prisma db seed cd ..
-
Start the development servers
npm run dev
The client will be available at
http://localhost:3000and the server athttp://localhost:4000.