Because the safest path and the shortest path are two very different things.
Every day, millions of women make a decision that most people never think about โ "Is this route safe enough?"
Traditional maps like Google Maps optimize for speed and distance. They don't know which street is poorly lit. They don't know which lane has a history of incidents. They don't factor in whether a route has CCTV coverage or is near a police station.
Avaya was built to change that.
We show you the safest route, not just the shortest one โ scored dynamically using real-world safety factors, adjusted in real-time based on the time of day.
Every road segment on the map is scored and color-coded based on real factors:
| Factor | How It's Used |
|---|---|
| ๐ก Street Lighting | Lit roads boost the safety score |
| ๐น CCTV Presence | Surveilled areas score higher |
| ๐ฅ Crowd Density | High-traffic areas feel safer |
| ๐ Police Proximity | Closer to a station = higher score |
| ๐ Incident History | Past reports lower the score |
| ๐ Time of Day | Scores dynamically adjust at night |
Routes are presented side-by-side โ so you can compare the safest path vs. the shortest path and make an informed choice.
When every second counts, Avaya's SOS button does everything at once:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ ONE TAP โ
โ โ
โ โ ๐ Pins your exact live location on the map โ
โ โ ๐ Sends location to nearest police station โ
โ โ ๐ข Posts an alert to the community feed โ
โ โ
โ No typing. No searching. Just one tap. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
A built-in social safety network where users can:
- ๐ Share safety tips and local advisories
โ ๏ธ Report incidents to warn others in real-time- ๐จ See SOS alerts from nearby users with live location
- ๐ฌ Comment and support each other
- โค๏ธ Like posts to surface the most important ones
Powered by Clerk, Avaya supports:
- Email/password sign-up & sign-in
- Social login (Google, GitHub, etc.)
- Protected routes โ map & community require authentication
- User avatars and profile management
avaya/
โโโ client/ # React Frontend
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ Map/ # AvayaMap, RoadLayer, UserMarker, DestinationMarker
โ โ โ โโโ UI/ # SOSButton, SOSModal, SearchBar, RoutePanel,
โ โ โ โ # RouteSelectorPanel, SafetyLegend, Toast, etc.
โ โ โ โโโ Layout/ # SiteHeader, SiteFooter, SiteLayout, AuthLayout
โ โ โโโ pages/ # Landing, Map, SignIn, SignUp, About, Contact,
โ โ โ # HowItWorks, SafetyTips, NotFound
โ โ โโโ services/ # API client (Axios)
โ โ โโโ store/ # Zustand state management
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ main.jsx # App entry with Clerk provider
โ โโโ package.json
โ
โโโ backend/ # Node.js API Server
โ โโโ src/
โ โ โโโ routes/
โ โ โ โโโ roads.js # Safe routing engine + road segments API
โ โ โ โโโ police.js # Nearest police station lookup
โ โ โโโ db/
โ โ โ โโโ index.js # PostgreSQL + PostGIS schema, triggers, views
โ โ โโโ middleware/
โ โ โโโ errorHandler.js
โ โโโ server.js # Express entry point
โ โโโ package.json
โ
โโโ README.md
| Technology | Purpose |
|---|---|
| React 19 | UI framework with latest concurrent features |
| Vite 7 | Lightning-fast dev server and build tool |
| Tailwind CSS 4 | Utility-first styling |
| Leaflet + React-Leaflet | Interactive safety maps with custom layers |
| Clerk | Authentication, user management, and protected routes |
| Zustand | Lightweight state management |
| Axios | HTTP client for API communication |
| Lucide React | Beautiful, consistent iconography |
| React Router DOM 7 | Client-side routing and navigation |
| Technology | Purpose |
|---|---|
| Node.js | Server runtime |
| Express 5 | Web framework for API routes |
| PostgreSQL | Relational database |
| PostGIS | Spatial queries โ distance, geometry, geolocation |
| pgRouting | Graph-based shortest/safest path computation |
| NeonDB | Serverless PostgreSQL hosting |
| Graphology | In-memory graph processing for route optimization |
| dotenv | Environment variable management |
Avaya computes a dynamic safety score (0โ10) for every road segment using a custom SQL view:
Final Score = Base Safety Score
+ Lighting Bonus (+1.0 if lit)
+ CCTV Bonus (+1.0 if present)
+ Crowd Level Bonus (+1.0 high / -1.0 low)
+ Police Proximity Bonus (up to +2.0 based on distance)
- Incident Penalty (up to -3.0 based on reports)
ร Night Modifier (ร0.7 between 10 PM โ 5 AM)
This score is recalculated in real-time so the same road may be rated differently at noon versus midnight.
- Node.js โฅ 18
- PostgreSQL with PostGIS & pgRouting extensions (or a NeonDB account)
- Clerk account for authentication (clerk.com)
git clone https://github.com/your-username/avaya.git
cd avayacd backend
npm installCreate a .env file:
NODE_ENV=development
DATABASE_URL=postgresql://user:password@host/dbname?sslmode=require
PORT=5000Start the dev server:
npm run devVerify it's working:
GET http://localhost:5000/health
โ { "status": "ok", "db": "connected" }
cd client
npm installCreate a .env file:
VITE_API_BASE_URL=http://localhost:5000
VITE_CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_keyStart the dev server:
npm run devVisit http://localhost:5173 ๐
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/roads/segments |
Get all road segments with safety scores |
GET |
/api/roads/route |
Compute safest route between two points |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/police/nearest?lat=&lng= |
Find nearest active police station |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/community/posts |
Paginated community feed with filters |
POST |
/api/community/posts |
Create a new post |
GET |
/api/community/posts/:id |
Get post details with comments |
POST |
/api/community/posts/:id/comments |
Add a comment |
POST |
/api/community/posts/:id/like |
Toggle like on a post |
POST |
/api/community/sos-alert |
Trigger an SOS community alert |
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Server + database health check |
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ police_stations โ โ road_segments โ โ users โ
โโโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโค
โ id โโโโโโโ nearest_police_id โ โ id โ
โ name โ โ road_name โ โ name โ
โ phone โ โ safety_score โ โ phone โ
โ address โ โ lighting โ โ email โ
โ geom (Point) โ โ crowd_level โ โโโโโโโโโโโโโโโโโโ
โ active โ โ cctv_present โ โ
โโโโโโโโโโโโโโโโโโโโ โ incidents_reported โ โ
โ geom (LineString) โ โโโโโโโโดโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโ โincident_reportsโ
โโโโโโโโโโโโโโโโโโค
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ road_id โ
โ community_posts โ โ community_comments โ โ user_id โ
โโโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโโโโโโค โ description โ
โ id โโโโโโโ post_id โ โ geom (Point) โ
โ clerk_user_id โ โ clerk_user_id โ โโโโโโโโโโโโโโโโโโ
โ content โ โ content โ
โ category โ โ author_name โ โโโโโโโโโโโโโโโโโโ
โ is_sos โ โโโโโโโโโโโโโโโโโโโโโโโโ โcommunity_likes โ
โ sos_lat/lng โ โโโโโโโโโโโโโโโโโโค
โ author_name โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ post_id โ
โโโโโโโโโโโโโโโโโโโโ โ clerk_user_id โ
โโโโโโโโโโโโโโโโโโ
Triggers:
trg_police_proximityโ auto-assigns the nearest police station to new road segmentstrg_incident_countโ syncs incident count when new reports are filed
Views:
v_road_safetyโ pre-computed final safety scores with time-of-day adjustments
| Page | Route | Description |
|---|---|---|
| ๐ Landing | / |
Hero section, feature showcase, how-it-works |
| ๐บ๏ธ Map | /map |
Interactive safety map with routing (auth required) |
| ๐ How It Works | /how-it-works |
Step-by-step guide to using Avaya |
| ๐ก๏ธ Safety Tips | /safety-tips |
Curated safety advice for women travelers |
| โน๏ธ About | /about |
About the project and team |
| ๐ Contact | /contact |
Contact form and information |
| ๐ Sign In | /sign-in |
Clerk authentication |
| ๐ Sign Up | /sign-up |
New user registration |
The name comes from Abhaya (เค เคญเคฏ) โ a Sanskrit word meaning fearless or without fear.
Avaya is our promise: a world where women can navigate any city, any street, at any hour โ without fear.
"Take up space. We'll handle the safety."
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License.
Built with โค๏ธ for a safer world
Avaya โ Let her walk safely.