An anonymous chatroom application built with Node.js, Socket.IO, Express, and the Uploadcare API for file uploads.
- Real-time chat functionality using Socket.IO
- Create and join chat rooms
- Upload and share images in chat rooms using Uploadcare API
- User-friendly UI with Tailwind CSS
To install and run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/code3-dev/socketio-chatroom.git cd socketio-chatroom
-
Install the dependencies:
npm install
-
Start the server:
npm start
-
Open your browser and navigate to
http://localhost:3000
.
- Open the application in your browser.
- Enter a room name and your username.
- Click "Create Room" to enter the chat room.
- Share the room URL with others or open the room URL yourself.
- Enter your username to join the chat room.
- Type your message in the chat input and press "Send".
- To upload an image, click the file upload button, select an image, and it will be shared in the chat room.
The server configuration is primarily managed through the server.js
file. Here is an overview of the key components:
- Express server setup: Serves static files and handles main page routes.
- Socket.IO setup: Manages socket events for joining rooms, sending messages, and uploading files.
- File uploads: Handled via the Uploadcare API, with the logic in
upload.js
.
Edit config.env
file in the root of your project and add the following:
JWT_SECRET="your_jwt_secret_key"
UPLOADCARE_PUBLIC_KEY="your_uploadcare_public_key"
SESSION_SECRET="your_session_secret_key"
We welcome contributions! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
- Name: Hossein Pira
- Email: h3dev.pira@gmail.com
- Instagram: h3dev.pira
- Telegram: h3dev
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using SocketIO Chatroom! If you have any questions or feedback, feel free to reach out via the contact information above.