An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# Online Mediator — AI-Powered Mediator Chat App

Screenshot 2025-04-14 at 6 20 49 PM

Screenshot 2025-04-14 at 6 24 09 PM

```
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)