Hivemind.tmp is a secure real-time chat application built with Spring Boot for the backend and Next.Js for the frontend. It ensures user privacy through end-to-end encryption, where each message is secured using the recipient's public key, making it readable only by the intended recipient.
It started as a personal project to help me learn and explore the capabilities of Spring Boot, a framework I’m currently studying. Over time, I saw a lot of potential in the idea, and it will likely continue to receive updates and improvements in the future.
- 📸 Screenshots
- ✨ Features
- 🧰 Tech Stack
- 🔒 Hybrid Cryptography Explanation
- 🚀 Getting Started
- 📦 Usage/Examples
- 🤝 Contributing
start.mp4
- 🧠 Real-time messaging using WebSockets
- 🔐 End-to-end encryption for all messages
- 👤 User authentication and authorization
- 🌐 Global chat and private messaging (group chats coming soon)
- 🔑 Easy private key backup
- 🪪 Authentication using JWT
HiveMind.tmp uses hybrid cryptography to securely encrypt all messages exchanged between users.
The application combines symmetric encryption, which is fast and efficient for encrypting the message content, with asymmetric encryption, which is used to securely share the symmetric keys between users.
🔄 Message Flow When a user sends a message:
-
A new symmetric key is generated (each message has its own key).
-
The message is encrypted using the symmetric key.
-
The symmetric key is encrypted using the recipient's public key.
-
Both the encrypted symmetric key and the encrypted message are sent to the backend.
When the recipient receives a message:
-
They use their private key to decrypt the symmetric key.
-
The decrypted symmetric key is then used to decrypt the actual message content.
The following image explains the flow:
Clone this repository Make sure you have the following installed:
- Java 21+
- Maven (optional, if not using docker)
- Node.js (for the frontend)
- Docker (or locally configured instance of PostgreSQL)
- Clone the repository
git clone https://github.com/Catskhi/HiveMind.tmp.git
- Configure environment variables
In the backend folder, set up the following variables on the .env file:
# Custom JWT secret
JWT_SECRET=""
# Database
DB_URL=""
DB_USERNAME=""
DB_PASSWORD=""
# Allowed origins of the server CORS configuration
ALLOWED_ORIGINS=
# Your custom chat secret
CHAT_SECRET=In the root folder, set up the following variables on the .env file:
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=- Start the application with Docker:
docker-compose up
- In the frontend folder, install the dependencies:
npm install
- Set up the following environment variables:
# Example: http://localhost:8080
NEXT_PUBLIC_BACKEND_BASE_URL=
# Example: ws://localhost:8080/ws
NEXT_PUBLIC_BACKEND_BASE_WEBSOCKET_URL=- Build and run the project:
npm run build && npm run start
Once the application is running, you can:
- Create an account and back-up your private key:
- Create an account using your credentials.
- Copy your private key or save it as a file on the private key page.
- Send a Private Message:
- Log in with your credentials.
- Select a user from the global chat list.
- Type your message and hit send. The recipient will see it instantly!
I welcome contributions to HiveMind.tmp! To get started:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes and commit them (
git commit -m "Add your message"). - Push to your fork (
git push origin feature/your-feature-name). - Open a Pull Request.
Please ensure your code follows the existing style and includes tests where applicable.

