FemSecure is a MERN-based women safety application designed around fast emergency action, trusted contacts, community reporting, and practical safety guidance. The current implementation pairs a React dashboard with an Express and MongoDB backend using JWT authentication.
The codebase supports the following user-facing flows:
- Phone/password registration and login.
- Emergency contact management per authenticated user.
- Safety concern reporting with common incident categories.
- Browser-based location capture.
- A simulated safety score based on coarse location rules.
- A simulated SOS alert and check-in timer experience.
- Static emergency numbers and safety tips.
- Frontend: React, Axios, React Scripts, Lucide React.
- Backend: Express, Mongoose, JWT, bcryptjs, CORS, dotenv.
- Storage: MongoDB.
The active app entrypoint is frontend/src/index.js, which renders frontend/src/App.jsx. The repository also contains a modular component set under frontend/src/components and a separate auth context in frontend/src/AuthContext.js. Those modules are useful reference implementations, but the live shell is currently driven by App.jsx.
FemSecure/
├── backend/
│ ├── server.js
│ ├── config/
│ ├── middleware/
│ ├── models/
│ └── routes/
└── frontend/
├── public/
└── src/
├── App.jsx
├── AuthContext.js
├── components/
└── services/
- Authentication with JWT-based sessions stored in
localStorage. - User-scoped contacts and reports backed by MongoDB.
- Contact and report deletion restricted to the authenticated owner.
- Geolocation capture in the browser with a simple location readout.
- Check-in timer UI that simulates an expiry alert.
- SOS modal feedback for emergency-style actions.
- Safety resources with emergency numbers and best-practice tips.
Base URL: http://localhost:5000/api
Authentication:
POST /auth/registerPOST /auth/loginGET /auth/me
Contacts:
GET /contactsPOST /contactsDELETE /contacts/:id
Reports:
GET /reportsPOST /reportsDELETE /reports/:id
Profile:
PUT /profile/location
- User:
name,phone, optionalemail, hashedpassword, timestamps. - Contact:
user,name,phone, timestamps. - Report:
user,type,location, timestamps.
- Node.js 18+ recommended.
- MongoDB running locally or a MongoDB Atlas connection string.
Create backend/.env with:
MONGODB_URI=mongodb://localhost:27017/femsecure
JWT_SECRET=your_secure_jwt_secret
PORT=5000If MONGODB_URI is omitted, the backend falls back to the local MongoDB URI shown above. If JWT_SECRET is omitted, the app uses a fallback secret, but a custom value is strongly recommended.
The frontend can optionally use REACT_APP_API_URL to override the API base URL. If it is not set, the frontend defaults to http://localhost:5000/api.
cd backend
npm install
cd ../frontend
npm installcd backend
npm run devcd frontend
npm startThe backend listens on http://localhost:5000 by default and the frontend runs on http://localhost:3000.
- The SOS alert, safety score, and missed check-in states are simulated in the UI and do not send real notifications.
- Reports and contacts are fully user-scoped on the backend.
PUT /api/profile/locationaccepts coordinates but does not persist a full location history.backend/routes/profile.jscurrently exposes location updates without authentication middleware.- The modular profile component expects a
PUT /profileendpoint, but that route is not implemented in the backend. - The repository contains both inline dashboard logic in
App.jsxand modular components infrontend/src/components; the inline shell is the active one.
- No
.env.examplefiles are present yet. - Some frontend modules use the shared Axios client while the main app shell still uses direct
fetchcalls. - The app currently focuses on a simulated safety experience rather than live emergency integrations.
- Add authenticated profile persistence.
- Persist location history and safety state in MongoDB.
- Add SMS, push, or webhook-based emergency notifications.
- Replace simulated risk scoring with real map or incident data.
- Consolidate the frontend around either the inline shell or the modular component set.
Darshan P Pawar
- GitHub: @DarshanPawar7
- Email: darshanpawarworks@email.com
- LinkedIn: Darshan P Pawar
Maintained by Darshan P Pawar.
No license has been specified yet.