Skip to content

An anonymous chatroom application built with Node.js, Socket.IO, Express, and the Uploadcare API for file uploads.

License

Notifications You must be signed in to change notification settings

code3-dev/socketio-chatroom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SocketIO Chatroom V3

An anonymous chatroom application built with Node.js, Socket.IO, Express, and the Uploadcare API for file uploads.

Table of Contents

Features

  • 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

Installation

To install and run the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/code3-dev/socketio-chatroom.git
    cd socketio-chatroom
  2. Install the dependencies:

    npm install
  3. Start the server:

    npm start
  4. Open your browser and navigate to http://localhost:3000.

Usage

Creating a Chat Room

  1. Open the application in your browser.
  2. Enter a room name and your username.
  3. Click "Create Room" to enter the chat room.

Joining a Chat Room

  1. Share the room URL with others or open the room URL yourself.
  2. Enter your username to join the chat room.

Chatting and Sharing Files

  1. Type your message in the chat input and press "Send".
  2. To upload an image, click the file upload button, select an image, and it will be shared in the chat room.

Configuration

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.

Environment Variables

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"

Contributing

We welcome contributions! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a pull request.

Contact

License

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.

About

An anonymous chatroom application built with Node.js, Socket.IO, Express, and the Uploadcare API for file uploads.

Resources

License

Stars

Watchers

Forks

Packages

No packages published