FreeCord is a Discord-like voice and text chat application that allows users to join voice channels, send text messages, and use a soundboard. This project is built using Node.js, Express, WebSocket, and WebRTC.
- Voice Chat: Communicate with others using WebRTC.
- Text Chat: Send and receive messages in real-time using WebSocket.
- Soundboard: Play audio files locally with sleek buttons.
- Admin CLI: Manage users, send admin messages, and record voice chat.
- Recording: Save voice chat as MP3 files for later use.
- Logs: Maintain a log of user activity and chat messages.
git clone https://github.com/your-username/discordclone.git
cd discordclonenpm install- Download and install ngrok from ngrok.com.
- Start ngrok to expose your local server:
ngrok http 3000- Copy the HTTPS URL provided by ngrok (e.g.,
https://d79f-84-199-37-243.ngrok-free.app).
- Open
public/js/config.js. - Replace the
websocketUrlvalue with your ngrok HTTPS URL:
const config = {
websocketUrl: "https://d79f-84-199-37-243.ngrok-free.app" // Replace with your ngrok URL
};node server.js- Open your browser and navigate to your given link.
- Enter a username and click "Join" to start using FreeCord.
The admin CLI allows you to manage users, send admin messages, and record voice chat. Here are the available commands:
users: List all connected users.getUserId <username>: Get the user ID for a given username.kick <username|userId>: Kick a user by username or user ID.record start: Start recording the voice chat.record stop: Stop recording the voice chat and save the MP3 file in theservermedia/recordingsfolder.adminmsg <message>: Send a message as the admin in the text chat. Admin messages appear in red to distinguish them from regular users.printlog: Save the activity log (user joins, leaves, and chat messages) toservermedia/log.txt.stop: Stop the server.
discordclone/
├── LICENSE
├── package.json
├── README.md
├── server.js
├── public/
│ ├── index.html
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ ├── config.js
│ │ └── script.js
│ └── media/
│ └── favicon.ico
└── servermedia/
├── log.txt
└── recordings/
- All user activity (joins, leaves, and chat messages) is logged in memory and can be saved to
servermedia/log.txtusing theprintlogcommand in the admin CLI.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
Made by shellduck8