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.
- 📂 Messages are saved as
.txtfiles (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.
- Node.js (v16 or higher)
- A shared network between devices
-
Clone the repository:
git clone https://github.com/aligunesv/termitalk.git cd termitalk -
Install dependencies:
npm install
-
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");
-
Start the server:
node server.js
- Open a terminal on the server machine.
- Run the following command to start the server:
node server.js
- The server will listen on port
3500for incoming connections. You should see a message indicating the server is running.
- On another computer in the same network, clone the TermiTalk repository and install dependencies as described above.
- Open the
client.jsfile in a text editor. - Locate the following line and replace
SERVER_IPwith the IP address of the server (the computer runningserver.js). If you want to test on the same machine, you can use127.0.0.1as 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:"); });
- Save the changes and run the client with the following command:
node client.js
- Once the client connects to the server, you can start typing your messages directly into the terminal.
- Each message you send will:
- Be saved in the
messages.txtfile on the server. - Overwrite the previous message in the file.
- Be broadcasted to all other connected clients in real time.
- Be saved in the
- All received messages will appear in the client terminal with their unique ID and timestamp.
- Server Terminal:
Server running on port 3500... New message received: ╭────────────────────────────╮ │ ID: d4f7f6e0-8b... │ │ Time: 2024-12-11 14:35 │ │ Message: Hello Server! │ ╰────────────────────────────╯ - Client Terminal:
After sending a message:
Connected to the server. Messages will be shown automatically when updated. Write your message:
Your message: Hi there! New message from another user: ╭────────────────────────────╮ │ ID: abcd1234-ef... │ │ Time: 2024-12-11 14:37 │ │ Message: Hello! │ ╰────────────────────────────╯
╭────────────────────────────╮
│ New Message: │
│ ID: d4f7f6e0-8b... │
│ Time: 2024-12-11 14:35 │
│ Message: Hello World! │
╰────────────────────────────╯ - 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.
Contributions are welcome! If you have ideas to improve TermiTalk, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- 🔒 Message Encryption: Add encryption for secure communication.
- 📝 Message Archiving: Save and retrieve message history.
- 🌐 Cross-Network Support: Enable messaging across different networks.
Happy coding! 😊