Skip to content

aligunesv/termitalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TermiTalk

Anonymous Terminal Messaging System

TermiTalk is a lightweight Node.js-based application that allows anonymous messaging between computers on the same network, entirely via the terminal. Messages are saved in a .txt file, ensuring simplicity and minimal resource usage.


Features

  • 📂 Messages are saved as .txt files (overwriting the previous message).
  • 🕶️ Fully anonymous with unique IDs (UUIDs) for each message.
  • 🕒 Timestamped messages for clear tracking.
  • ⚡ Real-time communication between clients via the terminal.
  • 🎨 Aesthetic terminal output with colors and borders.

Requirements

  • Node.js (v16 or higher)
  • A shared network between devices

Installation

  1. Clone the repository:

    git clone https://github.com/aligunesv/termitalk.git  
    cd termitalk  
  2. Install dependencies:

    npm install  
  3. Update the file path for message storage in server.js (default: C:/Users/Administrator/Desktop/msg/messages.txt):

    const msgFilePath = path.join("C:", "Users", "Administrator", "Desktop", "msg", "messages.txt");  
  4. Start the server:

    node server.js  

Usage

Step 1: Start the Server

  1. Open a terminal on the server machine.
  2. Run the following command to start the server:
    node server.js
  3. The server will listen on port 3500 for incoming connections. You should see a message indicating the server is running.

Step 2: Connect Clients to the Server

  1. On another computer in the same network, clone the TermiTalk repository and install dependencies as described above.
  2. Open the client.js file in a text editor.
  3. Locate the following line and replace SERVER_IP with the IP address of the server (the computer running server.js). If you want to test on the same machine, you can use 127.0.0.1 as the IP address:
    client.connect(3500, "SERVER_IP", () => {
        console.log("Connected to the server. Messages will be shown automatically when updated.");
        console.log("Write your message:");
    });
  4. Save the changes and run the client with the following command:
    node client.js

Step 3: Start Messaging

  1. Once the client connects to the server, you can start typing your messages directly into the terminal.
  2. Each message you send will:
    • Be saved in the messages.txt file on the server.
    • Overwrite the previous message in the file.
    • Be broadcasted to all other connected clients in real time.
  3. All received messages will appear in the client terminal with their unique ID and timestamp.

Example Interaction

  1. Server Terminal:
    Server running on port 3500...
    New message received:
    ╭────────────────────────────╮
    │ ID: d4f7f6e0-8b...         │
    │ Time: 2024-12-11 14:35    │
    │ Message: Hello Server!     │
    ╰────────────────────────────╯
  2. Client Terminal:
    Connected to the server. Messages will be shown automatically when updated.
    Write your message:
    After sending a message:
    Your message: Hi there!
    New message from another user:
    ╭────────────────────────────╮
    │ ID: abcd1234-ef...         │
    │ Time: 2024-12-11 14:37    │
    │ Message: Hello!            │
    ╰────────────────────────────╯

Example Output

Terminal View

╭────────────────────────────╮  
│ New Message:              │  
│ ID: d4f7f6e0-8b...        │  
│ Time: 2024-12-11 14:35    │  
│ Message: Hello World!     │  
╰────────────────────────────╯  

Dependencies

  • net: For TCP connections.
  • fs: To manage file operations.
  • path: For creating safe and dynamic file paths.
  • uuid: To generate unique IDs for messages.
  • date-fns: For formatting timestamps.
  • chalk: To add color to terminal output.
  • boxen: To create styled message boxes in the terminal.

Contributing

Contributions are welcome! If you have ideas to improve TermiTalk, feel free to open an issue or submit a pull request.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Future Plans

  • 🔒 Message Encryption: Add encryption for secure communication.
  • 📝 Message Archiving: Save and retrieve message history.
  • 🌐 Cross-Network Support: Enable messaging across different networks.

Happy coding! 😊

About

TermiTalk is a lightweight Node.js-based application that allows anonymous messaging between computers on the same network, entirely via the terminal. Messages are saved in a `.txt` file, ensuring simplicity and minimal resource usage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors