# mouez-jedidi/love_allert architecture

> Architecture diagram of the GitHub repository mouez-jedidi/love_allert, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mouez-jedidi/love_allert
- Repository: https://github.com/mouez-jedidi/love_allert

## Overview

Love Alert is a location-based matching and chat app with an Expo mobile client and Express/MongoDB backend. Users onboard, authenticate and complete a profile; the client can submit GPS location and request nearby matches. The backend proposes and records matches, users can accept, then chat; messaging and trust progress reveal profile details. The README also documents real-time updates, push and email notifications. Routes, controller/model references and several client-service calls are supported by the source index or excerpts; other feature links are limited to documented capabilities where implementation was not sampled.

Main entry points: [`mobile/services/api.js`](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/api.js) (REST client), [`mobile/App.js`](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/App.js) (App navigation), [`backend/routes`](https://github.com/mouez-jedidi/love_allert/tree/main/backend/routes) (API routes), [`backend/controllers/matchController.js`](https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/matchController.js) (Nearby matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile experience"]
  node_app["App navigation<br/>[App.js]"]
  node_authui["Onboarding and auth<br/>[AuthScreen.js]"]
  node_profileui["Profile experience<br/>[ProfileScreen.js]"]
  node_homeui["Discovery home<br/>[HomeScreen.js]"]
  node_matchui["Match flow<br/>[MatchScreen.js]"]
  node_chatui["Chat experience<br/>[ChatScreen.js]"]
  node_galleryui["Photo gallery<br/>[GalleryScreen.js]"]
end

subgraph group_api["API and domain"]
  node_server["Express server<br/>[server.js]"]
  node_routes["API routes"]
  node_auth["Authentication<br/>[authController.js]"]
  node_users["User profiles<br/>[userController.js]"]
  node_matching["Nearby matching<br/>[matchController.js]"]
  node_messages["Messaging"]
end

subgraph group_realtime["Realtime and notifications"]
  node_socketserver["Socket events<br/>[socket.js]"]
  node_push["Push notifications"]
  node_email["Email delivery<br/>[email.js]"]
  node_sms["Phone verification<br/>[twilio.js]"]
end

subgraph group_data["Persistence and integrations"]
  node_userdb[("User records<br/>[User.js]")]
  node_matchdb[("Match records<br/>[Match.js]")]
  node_messagedb[("Message records<br/>[Message.js]")]
end

subgraph group_clientservices["Client services"]
  node_api["REST client<br/>[api.js]"]
  node_gps["GPS updates<br/>[gps.js]"]
  node_socketclient["Socket client<br/>[socket.js]"]
  node_upload["Photo uploads<br/>[upload.js]"]
end

node_user(("App user"))
node_mongo[("MongoDB")]
node_notificationservice["Push provider"]
node_emailservice["Email provider"]
node_smsservice["SMS provider"]
node_gpsservice["Device location"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_homeui
node_app -->|"routes to"| node_matchui
node_app -->|"routes to"| node_chatui
node_authui -->|"calls"| node_api
node_profileui -->|"calls"| node_api
node_profileui -->|"uses"| node_upload
node_galleryui -->|"calls"| node_api
node_galleryui -->|"uses"| node_upload
node_homeui -->|"uses"| node_gps
node_homeui -->|"uses"| node_socketclient
node_homeui -->|"requests matches"| node_api
node_matchui -.->|"calls"| node_api
node_chatui -->|"calls"| node_api
node_chatui -->|"uses"| node_socketclient
node_gps -.->|"reads location"| node_gpsservice
node_api -.->|"sends REST requests"| node_server
node_server -->|"mounts"| node_routes
node_server -->|"initializes"| node_socketserver
node_server -->|"connects"| node_mongo
node_routes -->|"routes auth"| node_auth
node_routes -->|"routes users"| node_users
node_routes -->|"routes matches"| node_matching
node_routes -->|"routes messages"| node_messages
node_auth -->|"reads and writes"| node_userdb
node_auth -->|"sends verification"| node_email
node_auth -->|"verifies phone"| node_sms
node_users -->|"reads and writes"| node_userdb
node_matching -->|"queries users"| node_userdb
node_matching -->|"creates matches"| node_matchdb
node_matching -->|"sends alerts"| node_push
node_matching -->|"emits match events"| node_socketserver
node_messages -->|"reads and writes"| node_messagedb
node_messages -->|"updates match"| node_matchdb
node_messages -->|"loads participants"| node_userdb
node_messages -->|"notifies recipient"| node_push
node_push -->|"sends push"| node_notificationservice
node_email -.->|"delivers email"| node_emailservice
node_sms -.->|"sends OTP"| node_smsservice
node_userdb -.->|"persists"| node_mongo
node_matchdb -.->|"persists"| node_mongo
node_messagedb -.->|"persists"| node_mongo

click node_app "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/App.js"
click node_authui "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/AuthScreen.js"
click node_profileui "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/ProfileScreen.js"
click node_homeui "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/HomeScreen.js"
click node_matchui "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/MatchScreen.js"
click node_chatui "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/ChatScreen.js"
click node_galleryui "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/GalleryScreen.js"
click node_api "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/api.js"
click node_gps "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/gps.js"
click node_socketclient "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/socket.js"
click node_upload "https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/upload.js"
click node_server "https://github.com/mouez-jedidi/love_allert/blob/main/backend/server.js"
click node_routes "https://github.com/mouez-jedidi/love_allert/tree/main/backend/routes"
click node_auth "https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/authController.js"
click node_users "https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/userController.js"
click node_matching "https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/matchController.js"
click node_messages "https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/messageController.js"
click node_socketserver "https://github.com/mouez-jedidi/love_allert/blob/main/backend/config/socket.js"
click node_push "https://github.com/mouez-jedidi/love_allert/blob/main/backend/services/notificationService.js"
click node_email "https://github.com/mouez-jedidi/love_allert/blob/main/backend/config/email.js"
click node_sms "https://github.com/mouez-jedidi/love_allert/blob/main/backend/config/twilio.js"
click node_userdb "https://github.com/mouez-jedidi/love_allert/blob/main/backend/models/User.js"
click node_matchdb "https://github.com/mouez-jedidi/love_allert/blob/main/backend/models/Match.js"
click node_messagedb "https://github.com/mouez-jedidi/love_allert/blob/main/backend/models/Message.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authui,node_profileui,node_homeui,node_matchui,node_chatui,node_galleryui,node_user toneBlue
class node_server,node_routes,node_auth,node_users,node_matching,node_messages,node_mongo toneAmber
class node_socketserver,node_push,node_email,node_sms toneMint
class node_userdb,node_matchdb,node_messagedb toneRose
class node_api,node_gps,node_socketclient,node_upload,node_notificationservice,node_emailservice,node_smsservice,node_gpsservice toneIndigo
```

## Components

### Mobile experience

- [App navigation](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/App.js): `mobile/App.js`
- [Onboarding and auth](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/AuthScreen.js): `mobile/screens/AuthScreen.js`
- [Profile experience](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/ProfileScreen.js): `mobile/screens/ProfileScreen.js`
- [Discovery home](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/HomeScreen.js): `mobile/screens/HomeScreen.js`
- [Match flow](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/MatchScreen.js): `mobile/screens/MatchScreen.js`
- [Chat experience](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/ChatScreen.js): `mobile/screens/ChatScreen.js`
- [Photo gallery](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/screens/GalleryScreen.js): `mobile/screens/GalleryScreen.js`

### API and domain

- [Express server](https://github.com/mouez-jedidi/love_allert/blob/main/backend/server.js): `backend/server.js`
- [API routes](https://github.com/mouez-jedidi/love_allert/tree/main/backend/routes): `backend/routes`
- [Authentication](https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [User profiles](https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Nearby matching](https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/matchController.js): `backend/controllers/matchController.js`
- [Messaging](https://github.com/mouez-jedidi/love_allert/blob/main/backend/controllers/messageController.js): `backend/controllers/messageController.js`

### Realtime and notifications

- [Socket events](https://github.com/mouez-jedidi/love_allert/blob/main/backend/config/socket.js): `backend/config/socket.js`
- [Push notifications](https://github.com/mouez-jedidi/love_allert/blob/main/backend/services/notificationService.js): `backend/services/notificationService.js`
- [Email delivery](https://github.com/mouez-jedidi/love_allert/blob/main/backend/config/email.js): `backend/config/email.js`
- [Phone verification](https://github.com/mouez-jedidi/love_allert/blob/main/backend/config/twilio.js): `backend/config/twilio.js`

### Persistence and integrations

- [User records](https://github.com/mouez-jedidi/love_allert/blob/main/backend/models/User.js): `backend/models/User.js`
- [Match records](https://github.com/mouez-jedidi/love_allert/blob/main/backend/models/Match.js): `backend/models/Match.js`
- [Message records](https://github.com/mouez-jedidi/love_allert/blob/main/backend/models/Message.js): `backend/models/Message.js`

### Client services

- [REST client](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/api.js): `mobile/services/api.js`
- [GPS updates](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/gps.js): `mobile/services/gps.js`
- [Socket client](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/socket.js): `mobile/services/socket.js`
- [Photo uploads](https://github.com/mouez-jedidi/love_allert/blob/main/mobile/services/upload.js): `mobile/services/upload.js`

### Other components

- **App user**
- **MongoDB**
- **Push provider**
- **Email provider**
- **SMS provider**
- **Device location**

## Connections

- App user → App navigation: uses (evidence: `README.md`)
- App navigation → Onboarding and auth: routes to (evidence: `mobile/App.js`)
- App navigation → Profile experience: routes to (evidence: `mobile/App.js`)
- App navigation → Discovery home: routes to (evidence: `mobile/App.js`)
- App navigation → Match flow: routes to (evidence: `mobile/App.js`)
- App navigation → Chat experience: routes to (evidence: `mobile/App.js`)
- Onboarding and auth → REST client: calls (evidence: `mobile/screens/AuthScreen.js`)
- Profile experience → REST client: calls (evidence: `mobile/screens/ProfileScreen.js`)
- Profile experience → Photo uploads: uses (evidence: `mobile/screens/ProfileScreen.js`)
- Photo gallery → REST client: calls (evidence: `mobile/screens/GalleryScreen.js`)
- Photo gallery → Photo uploads: uses (evidence: `mobile/screens/GalleryScreen.js`)
- Discovery home → GPS updates: uses (evidence: `mobile/screens/HomeScreen.js`)
- Discovery home → Socket client: uses (evidence: `mobile/screens/HomeScreen.js`)
- Discovery home → REST client: requests matches (evidence: `mobile/screens/HomeScreen.js`)
- Match flow → REST client: calls
- Chat experience → REST client: calls (evidence: `mobile/screens/ChatScreen.js`)
- Chat experience → Socket client: uses (evidence: `mobile/screens/ChatScreen.js`)
- GPS updates → Device location: reads location
- REST client → Express server: sends REST requests
- Express server → API routes: mounts (evidence: `backend/server.js`)
- Express server → Socket events: initializes (evidence: `backend/server.js`)
- Express server → MongoDB: connects (evidence: `backend/server.js`)
- API routes → Authentication: routes auth (evidence: `backend/routes/auth.js`)
- API routes → User profiles: routes users (evidence: `backend/routes/users.js`)
- API routes → Nearby matching: routes matches (evidence: `backend/routes/matches.js`)
- API routes → Messaging: routes messages (evidence: `backend/routes/messages.js`)
- Authentication → User records: reads and writes (evidence: `backend/controllers/authController.js`)
- Authentication → Email delivery: sends verification (evidence: `backend/controllers/authController.js`)
- Authentication → Phone verification: verifies phone (evidence: `backend/controllers/authController.js`)
- User profiles → User records: reads and writes (evidence: `backend/controllers/userController.js`)
- Nearby matching → User records: queries users (evidence: `backend/controllers/matchController.js`)
- Nearby matching → Match records: creates matches (evidence: `backend/controllers/matchController.js`)
- Nearby matching → Push notifications: sends alerts (evidence: `backend/controllers/matchController.js`)
- Nearby matching → Socket events: emits match events (evidence: `backend/controllers/matchController.js`)
- Messaging → Message records: reads and writes (evidence: `backend/controllers/messageController.js`)
- Messaging → Match records: updates match (evidence: `backend/controllers/messageController.js`)
- Messaging → User records: loads participants (evidence: `backend/controllers/messageController.js`)
- Messaging → Push notifications: notifies recipient (evidence: `backend/controllers/messageController.js`)
- Push notifications → Push provider: sends push (evidence: `backend/services/notificationService.js`)
- Email delivery → Email provider: delivers email
- Phone verification → SMS provider: sends OTP
- User records → MongoDB: persists
- Match records → MongoDB: persists
- Message records → MongoDB: persists
