A modern, real-time chat application built with React, TypeScript, and Socket.IO. This application allows users to create custom chat rooms, join existing rooms, and communicate with other users in real-time.
- Real-time messaging using Socket.IO
- Custom room creation and joining
- User presence indicators
- Message history persistence within rooms
- Express backend with Socket.IO integration
- Clone the repository:
git clone <repository-url>
cd espresso-chat-app
- Install dependencies for both client and server:
# Install client dependencies
cd client
npm install
# Install server dependencies
cd ../server
npm install
- Start the server:
cd server
npm run dev
The server will start on port 3001.
- Start the client (in a new terminal):
cd client
npm start
The client will start on port 3000.
- Open your browser and navigate to
http://localhost:3000
- Enter your username and join a room
- Create a custom room or join an existing one
- Start chatting with other users in the room
- Messages are preserved when users leave and rejoin the room
test-app/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── context/ # React context providers
│ │ └── App.tsx # Main application component
│ └── package.json
│
└── server/ # Express backend
├── src/
│ └── index.ts # Server entry point
└── package.json
- Instead of Context API, I would have used Redux or Zustand because they are more scalable, but in the interest of time, I stuck with Context.
- I would add touches to the UI (for instance style the select).
- There is a bug I found that I was working to solve regarding the messages. I would have fixed this.
- I would have made the app responsive
- I would have used SASS and CSS modules and have the CSS in their own files.
- I would have put the types in their own files.
- I would have implemented JWT for more secure authentication.
- I would have allowed users to create proper user accounts with passwords.
- I would have stored user information in a database.
- I would have implemented password hashing
- I would have added logout functionality
I had a blast working on this, hope you're having a great weekend!