A real-time chat room application built from scratch, including both backend and frontend components.
- Frontend: React
- Backend: Express.js, Socket.io
- Data Store: Redis
- Remote State Management: TanStack Query + Axios
- Styling: Styled-Components
-
Chat Room Management
- Create chat rooms with custom names.
- Protect chat rooms with passwords for secure access.
-
Real-Time Messaging
- Instant chat powered by Socket.io for seamless communication.
-
Encrypted Communication
- Basic message encryption using
crypto.subtle
andAES-CBC
for added security.
- Basic message encryption using
-
Self-Destructing Rooms
- Chat rooms automatically self-destruct after a configurable time period.
-
Kill Switch
- Each room member has access to a Kill Switch to permanently delete all messages for all users.
-
Online Users List
- See real-time indications of online users and a list of participants in each room.
-
Clone the Repository
git clone <repoUrl>
-
Configure Redis
The application uses a Redis instance managed by Docker. Ensure you have Docker Desktop installed.Then run:
docker compose up
docker-desktop required on windows
-
Generate SSL certificates
Generate SSL certificates for both the backend and frontend using tools like
openssl
ormakecert
. Save them with the following filenames:cert.pem
(SSL certificate)key.pem
(Private key)
Place these files in the root directory of both the backend and frontend folders..
Encryption requires HTTPS!
If using openssl, ensure to manually trust both the backend and frontend.
-
Configure .env and install dependencies:
-
To configure your environment, create a .env file in the root directory of both backend and frontend and set the required variables like the
.env.example
files. -
Install Dependencies via:
npm i
-
-
Start backend
Navigate to the backend directory and start the server:
node server.js
-
Start frontend server
Navigate to the frontend directory and start the development server:
npm run dev
This project is licensed under the MIT License.
If you’d like to contribute to the development of SafeRoom, feel free to fork the repository and submit pull requests. We welcome suggestions and improvements!