A MERN-Stack Emergency Response Platform with Real-Time SOS Alerts
SafeSpace is a full-stack safety application designed to help users send instant emergency alerts (SOS) with live location, email notifications, and emergency contact management. Built using the MERN Stack, it ensures fast response, secure authentication, and seamless UI/UX.
- User Registration with email
- Secure Login with JWT
- Protected Routes
- Add, View, and Delete contacts
- Each contact includes Name, Phone, Email
- Stored securely in MongoDB
-
Centre emergency button
-
On tap:
- User's GPS location is captured
- Email alert is sent to all saved emergency contacts
- Timestamp is logged locally in the UI
- Google Maps view
- Route navigation
- Satellite/Map modes
- Real-time location tracking
- React
- Axios
- Google Maps API
- CSS / Inline UI Styling
- Node.js
- Express.js
- MongoDB
- Mongoose
- Nodemailer (for email SOS alerts)
- JWT Authentication
SafeSpace/
βββ backend/
β βββ routes/
β βββ models/
β βββ config/
β βββ server.js
β βββ .env β DO NOT COMMIT
β
βββ frontend/
βββ src/
βββ components/
βββ .env β DO NOT COMMIT
Your screenshot section is perfect β only one small improvement is needed:
π Right now, the description text appears on the SAME LINE as the image in GitHub. To fix that, you must add a blank line after each image tag.
Here is your entire corrected block, perfectly formatted for GitHub README.md:
This screen allows new users to create an account by entering their name, email, and password. The UI follows a glassmorphism card design for a clean and modern onboarding experience.
Users can securely log in using their registered email and password. The interface includes a gradient login button and a link to navigate to the registration page.
After login, the dashboard provides quick access to the main features β Home, Contacts, SOS, and Map. Each option is displayed as a large interactive tile for easy navigation.
Users can add new emergency contacts including Name, Phone Number, and Email. Saved contacts are displayed in a list format with an option to delete them if needed.
This interface contains a central SOS button that sends an emergency email alert along with the user's live location. A timestamp log is shown under the button displaying past SOS triggers.
The map screen uses Google Maps to display the userβs current location and allows route navigation. The top search bar helps users locate destinations, and real-time movement is supported.
git clone https://github.com/your-username/SafeSpace.gitcd backend
npm installCreate .env
MONGO_URI=your_mongodb_connection
JWT_SECRET=your_secret
EMAIL_USER=your_email
EMAIL_PASS=your_email_password_or_app_password
Start backend
npm run devcd frontend
npm installCreate .env
REACT_APP_API_URL=http://localhost:5000/api
REACT_APP_GOOGLE_MAPS_KEY=your_key
Start frontend
npm startWhen SOS is triggered, the emergency contacts receive an email:
Subject: π¨ SOS Alert β Immediate Help Needed!
Message:
User triggered an SOS alert.
Live Location:
https://www.google.com/maps?q=LAT,LNG
Please reach out immediately.
β .env files must NEVER be pushed to GitHub
β Use Gmail App Passwords for Nodemailer
β Ensure MongoDB IP whitelist is configured
Pull requests are welcome!
MIT License