This is a full-stack chat application built using React (with TypeScript) for the frontend and Node.js with Express for the backend. Real-time messaging is enabled using Socket.IO.
- Real-time messaging using Socket.IO.
- User-friendly frontend built with React and TypeScript.
- Responsive UI design.
- Backend with Node.js and Express.
- WebSocket integration for bi-directional communication.
- Clean and modular codebase.
- React: UI Library.
- TypeScript: For type safety and better developer experience.
- React-Bootstrap: For styling components.
- Node.js: Runtime environment.
- Express: Web framework.
- Socket.IO: Real-time communication library.
- MongoDB: For storing user and chat data.
Follow these steps to set up the project locally.
Ensure you have the following installed:
- Node.js
- npm or yarn
- MongoDB (if you are running the database locally)
-
Clone the Repository:
git clone https://github.com/your-username/chat-app.git cd chat-app -
Install Dependencies:
For the frontend:
cd frontend npm installFor the backend:
cd backend npm install -
Set Up Environment Variables:
-
Navigate to the
backenddirectory and create a.envfile by copying the contents from.env.sample. Replace the placeholder values with your configuration. -
Navigate to the
frontenddirectory and create a.envfile by copying the contents from.env.sample. Replace the placeholder values with your configuration.
Ensure that all required variables are properly set for both the backend and frontend to avoid runtime issues.
-
-
Start the Application:
Open two terminals: one for the backend and one for the frontend.
Backend:
cd backend npm run devFrontend:
cd frontend npm start -
Access the App: Visit
http://localhost:3000in your browser.