A full-stack real-time chat application built with React, TypeScript, Tailwind CSS on the frontend and Express.js, PostgreSQL, Prisma, Socket.io on the backend. QuickChat enables seamless one-on-one and group messaging with real-time updates, typing indicators, and user authentication.
- 🔑 User authentication with JWT
- 💬 One-on-one and group chat support
- ⏱ Real-time messaging with Socket.io
- ✍️ Typing indicators for an interactive chat experience
- 👥 Manage group members (add/remove users, assign admins)
- 📱 Responsive UI with Tailwind CSS
Frontend: React, TypeScript, Tailwind CSS
Backend: Node.js, Express.js, Socket.io
Database: PostgreSQL with Prisma ORM
Authentication: JSON Web Tokens (JWT)
-
Clone the repository:
git clone https://github.com/your-username/QuickChat.git cd QuickChat -
Install dependencies:
-
Backend:
cd server npm install -
Frontend:
cd ../client npm install
-
-
Setup environment variables:
-
Server
.envCreate a
.envfile inside theserverdirectory and configure the following:DATABASE_URL="postgresql://<username>:<password>@localhost:5432/chatapp?schema=public" JWT_SECRET="<your_jwt_secret>" CLIENT_URL="http://localhost:5173"
-
Client
.envCreate a
.envfile inside theclientdirectory and configure the following:VITE_BASE_URL="http://localhost:5000"
-
-
Run the application:
-
Start backend:
cd server npm run dev -
Start frontend (runs on port 3000 by default):
cd ../client npm run dev
-
-
Access the app:
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
QuickChat/
├── client/ # Frontend
│ ├── node_modules/
│ ├── public/
│ └── src/
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React context providers
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page-level components
│ ├── services/ # API service functions
│ ├── types/ # TypeScript type definitions
│ └── App.tsx
│
├── server/ # Backend
│ ├── node_modules/
│ ├── prisma/ # DB schema & migrations
│ └── src/
│ ├── controllers/ # Route handlers
│ ├── middlewares/ # Express middlewares
│ ├── routes/ # API route definitions
│ ├── sockets/ # Socket.io event handlers
│ ├── app.ts # Express app config
│ └── server.ts # Entry point
│
└── README.md
POST /register→ Register a new userPOST /login→ Login user and return JWTGET /me→ Get current user (requires authentication)
GET /→ Search usersGET /:id→ Get user by ID
POST /→ Create a new chatGET /→ Get all chats for authenticated userGET /:id→ Get chat by IDPUT /group→ Update group detailsPUT /group/add→ Add participant to groupPUT /group/remove→ Remove participant from group
POST /→ Send a messageGET /:chatId→ Get all messages in a chat
⚡ Note: All protected routes require a valid JWT token.