Madat (meaning "Help" in several Indian languages) is a web-based emergency reporting platform designed to bridge language barriers during crisis situations. It enables users to report emergencies by recording voice messages in their regional languages. These messages are automatically processed, transcribed, and translated to assist emergency responders in taking rapid action.
- Voice-First Interface: A "Push-to-Talk" interface allows users to record emergency messages quickly and easily.
- Visual Feedback: Real-time audio visualization (waveforms and bars) confirms that audio is being captured correctly during recording.
- Secure Reporting: Voice messages are encoded and securely transmitted to the backend server.
- Location Integration: (Planned/Implicit) The system is designed to facilitate automatic location sharing to assist responders.
- Live Dashboard: A centralized view for officers to monitor incoming emergency alerts in real-time.
- Audio Playback: Responders can listen to the original voice recording directly from the browser.
- AI Translation (Bhashini): Integrated Bhashini API support allows officers to translate regional voice messages (Hindi, Marathi, Gujarati, etc.) into English or other languages instantly for better understanding.
- Incident Tracking: Displays timestamps and message details for efficient incident management.
- React: Core framework for building the user interface.
- Redux Toolkit: Used for managing global state, specifically user authentication (
AuthSlice). - Lucide React: Provides modern, consistent iconography (Mic, Shield, MessageSquare, etc.).
- Tailwind CSS: Utilized for responsive, modern styling with a dark-themed, "cyberpunk" aesthetic.
- Axios: Handles HTTP requests to the backend API.
- Node.js & Express: Serves the REST API and handles routing.
- MongoDB & Mongoose: Stores user data and emergency messages.
- JWT (JSON Web Tokens): Manages secure user authentication and sessions.
- Bhashini API: External API integration for text-to-text and speech-to-text translation services.
HomePage.jsx: The main responder dashboard. It fetches messages, plays audio, and provides a dropdown to select languages for translation via Bhashini.RecordEMessage.jsx: The user interface for recording voice notes. It features a visualizer for audio levels and handles the conversion of audio blobs to Base64 for upload.- **
LoginPage.jsx&SignupPage.jsx**: Fully styled authentication pages with form validation and Redux integration. redux/: Contains the Redux store configuration andAuthSlicefor managing login/signup states.
-
index.js: The server entry point that connects to the database and sets up middleware (CORS, Cookie Parser). -
routes/: -
auth.route.js: Manages authentication endpoints (Login, Signup, Logout). -
bhashini.route.js: Handles requests to the Bhashini translation service. -
package.json: Lists dependencies includingbcryptjs,jsonwebtoken,mongoose, andtwilio.
- Node.js (v14 or higher)
- MongoDB (Local instance or Atlas URI)
- Clone the Repository
git clone <repository-url>
cd Madat
- Install Backend Dependencies
cd backend
npm install
- Install Frontend Dependencies
cd frontend
npm install
- Environment Configuration
Create a
.envfile in thebackenddirectory with the following variables:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
FRONTEND_URL=http://localhost:5173
- Run the Application
- Start the Backend:
npm run dev(uses nodemon) - Start the Frontend:
npm run dev(Vite/React)
- Register: Users must sign up using the Signup Page to access the system.
- Record: On the Record Message page, click the microphone icon. The visualizer will react to your voice. Click again to stop, then press send.
- Monitor: Emergency officers log in to the Home Page dashboard. They will see a list of recent voice messages.
- Translate: If a message is in a regional language (e.g., Hindi), select "Hindi" from the dropdown and click Translate to view the English text.
Contributions are welcome! Please fork the repository and create a pull request for any feature enhancements or bug fixes.
Developed with React, Node.js, MongoDB, and Bhashini AI