https://github.com/injusmol/online-mediator
A real-time MERN chat app enhanced with an AI-powered mediator that formalizes messages for thoughtful communication and conflict resolution.
https://github.com/injusmol/online-mediator
express flask mongodb react socket-io zustand
Last synced: 3 months ago
JSON representation
A real-time MERN chat app enhanced with an AI-powered mediator that formalizes messages for thoughtful communication and conflict resolution.
- Host: GitHub
- URL: https://github.com/injusmol/online-mediator
- Owner: InjuSmol
- Created: 2025-03-09T21:23:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-04T00:56:46.000Z (12 months ago)
- Last Synced: 2025-07-04T01:34:15.813Z (12 months ago)
- Topics: express, flask, mongodb, react, socket-io, zustand
- Language: JavaScript
- Homepage:
- Size: 10.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Online Mediator — AI-Powered Mediator Chat App


```
User → React Frontend (not shown)
↓
Express Server (Node.js)
↳ User Auth (MongoDB)
↳ Message API + Realtime via Socket.io
↳ /formalizer → Flask Microservice
↓
Hugging Face API: Formal Language Model
```
Online AI Mediator is a full-stack web application designed to facilitate thoughtful and respectful communication between users through real-time chat. Built with the MERN stack (MongoDB, Express, React, Node.js), socket.io for real-time messages exchanges. The platform integrates a Python-based Flask microservice that leverages a NLP model (prithivida/informal_to_formal_styletransfer) to transform informal or emotionally charged messages into a more formal and neutral tone before delivery.
This unique mediation layer fosters conflict resolution, reduces miscommunication, and promotes civil discourse — making the application suitable for environments where constructive communication is critical, such as online support groups, team collaboration platforms, or educational discussions. The application also features real-time user presence indicators, JWT-based authentication and authorization, modern UI styling with TailwindCSS and Daisy UI, global state management with Zustand, and end-to-end error handling.
The application is still under active development, and further improvements are planned for the NLP component to enhance efficiency and flexibility.
## Getting Started
### 1. Update the .env:
```bash
MONGODB_URI =
PORT = 5001
JWT_SECRET =
NODE_ENV = development
CLOUDINARY_CLOUD_NAME =
CLOUDINARY_API_KEY =
CLOUDINARY_API_SECRET =
PYTHON_API = http://python:5000/
HF_API_TOKEN =
```
### 2. Install dependencies
```bash
# For backend
cd backend
npm install
# For frontend
cd ../frontend
npm install
# For Python AI microservice
cd ../py_service
pip install -r requirements.txt
```
### 3. Run the services
In three separate terminals:
```bash
# Start Flask microservice
cd python
python3 app.py
# Start backend server
cd ../backend
npm run dev
# Start frontend
cd ../frontend
npm run dev
```
### 4. Access the Application locally:
Visit: [http://localhost:5173](http://localhost:5173)