# manju-nad-k/accedent-alert-project architecture

> Architecture diagram of the GitHub repository manju-nad-k/accedent-alert-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manju-nad-k/accedent-alert-project
- Repository: https://github.com/manju-nad-k/accedent-alert-project

## Overview

This repository is an accident-alert web application: users sign up or log in, save an emergency contact, and can trigger an SOS call from the home screen, optionally including their location. The Angular client talks to a Spring backend for authentication, profile, phone-number, and SOS operations; the backend also has JWT security, persistence entities and repositories, and Twilio configuration. The README is empty, and backend source was not sampled, so backend interactions beyond the frontend's HTTP endpoints are documented only where endpoint URLs support them; internal backend call paths are omitted.

Main entry points: [`frontend/src/app/app.routes.ts`](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/app.routes.ts) (Page routing), [`frontend/src/app/login/login.component.ts`](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/login/login.component.ts) (Login and signup), [`src/main/java/com/example/demo/service/UserService.java`](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/service/UserService.java) (User service), [`frontend/src/app/home/home.component.ts`](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/home/home.component.ts) (Emergency home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_bootstrap["App bootstrap<br/>[main.ts]"]
  node_routes["Page routing<br/>[app.routes.ts]"]
  node_shell["App shell<br/>[app.component.ts]"]
  node_login_ui["Login and signup<br/>[login.component.ts]"]
  node_login_api["Login API client<br/>[login.service.ts]"]
  node_home["Emergency home<br/>[home.component.ts]"]
  node_phone_client["Phone number client"]
  node_sos_client["SOS client<br/>[sos.service.ts]"]
  node_profile_ui["User profile"]
  node_profile_client["Profile API client"]
  node_safety["Road safety guidance"]
  node_about["About page<br/>[about.component.ts]"]
  node_call_page["Call page<br/>[call.component.ts]"]
end

subgraph group_server["Spring backend"]
  node_login_controller["Login endpoints"]
  node_phone_controller["Phone endpoints"]
  node_sos_controller["SOS endpoint<br/>[SosController.java]"]
  node_profile_controller["Profile endpoint"]
  node_user_service["User service<br/>[UserService.java]"]
  node_phone_service["Phone service"]
  node_sos_service["SOS service<br/>[SosService.java]"]
  node_twilio["Twilio integration<br/>[TwilioConfig.java]"]
end

subgraph group_security["Identity and security"]
  node_auth["Authentication state<br/>[auth.guard.ts]"]
  node_jwt_filter["JWT filter<br/>[JwtFilter.java]"]
  node_jwt_util["JWT utilities<br/>[JwtUtil.java]"]
  node_security_config["Security configuration"]
end

subgraph group_data["Persistence"]
  node_users_db[("User records")]
  node_phone_db[("Emergency numbers")]
  node_sos_db[("SOS requests<br/>[SosRepository.java]")]
end

node_user(("App user"))
node_twilio_service["Twilio calling service"]

node_user -->|"signs in"| node_login_ui
node_bootstrap -->|"starts"| node_shell
node_bootstrap -->|"configures"| node_routes
node_routes -->|"routes to"| node_login_ui
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_about
node_routes -->|"routes to"| node_call_page
node_routes -->|"routes to"| node_safety
node_routes -->|"routes to"| node_profile_ui
node_shell -->|"uses"| node_auth
node_login_ui -->|"submits credentials"| node_login_api
node_login_ui -->|"stores session"| node_auth
node_login_api -->|"HTTP auth"| node_login_controller
node_login_controller -.->|"delegates"| node_user_service
node_user_service -.->|"persists users"| node_users_db
node_home -->|"loads contact"| node_phone_client
node_home -->|"triggers alert"| node_sos_client
node_phone_client -->|"HTTP phone data"| node_phone_controller
node_phone_controller -.->|"delegates"| node_phone_service
node_phone_service -.->|"reads and writes"| node_phone_db
node_sos_client -->|"HTTP SOS"| node_sos_controller
node_sos_controller -.->|"delegates"| node_sos_service
node_sos_service -.->|"records request"| node_sos_db
node_sos_service -.->|"places call"| node_twilio_service
node_twilio_service -.->|"uses configuration"| node_twilio
node_profile_ui -->|"loads profile"| node_profile_client
node_profile_client -->|"HTTP profile"| node_profile_controller
node_profile_controller -.->|"delegates"| node_user_service
node_user_service -.->|"reads and writes"| node_users_db
node_security_config -.->|"configures filter"| node_jwt_filter
node_jwt_filter -.->|"checks tokens"| node_jwt_util

click node_bootstrap "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/main.ts"
click node_routes "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/app.routes.ts"
click node_shell "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/app.component.ts"
click node_login_ui "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/login/login.component.ts"
click node_login_api "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/Services/login.service.ts"
click node_home "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/home/home.component.ts"
click node_phone_client "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/service/calldb-service.service.ts"
click node_sos_client "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/Services/sos.service.ts"
click node_profile_ui "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/profile/profile.component.ts"
click node_profile_client "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/Services/use-profile-info.service.ts"
click node_safety "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/safetyy/safety.component.ts"
click node_about "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/about/about.component.ts"
click node_call_page "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/call/call.component.ts"
click node_auth "https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/auth.guard.ts"
click node_login_controller "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/LoginController.java"
click node_phone_controller "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/PhoneNumberController.java"
click node_sos_controller "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/SosController.java"
click node_profile_controller "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/UserProfileController.java"
click node_jwt_filter "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/security/JwtFilter.java"
click node_jwt_util "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/security/JwtUtil.java"
click node_security_config "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/security/SecurityConfig.java"
click node_user_service "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/service/UserService.java"
click node_phone_service "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/service/PhoneNumberService.java"
click node_sos_service "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/service/SosService.java"
click node_twilio "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/config/TwilioConfig.java"
click node_users_db "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/repository/UserRepository.java"
click node_phone_db "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/repository/PhoneNumberRepository.java"
click node_sos_db "https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/repository/SosRepository.java"

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_bootstrap,node_routes,node_shell,node_login_ui,node_login_api,node_home,node_phone_client,node_sos_client,node_profile_ui,node_profile_client,node_safety,node_about,node_call_page,node_user toneBlue
class node_login_controller,node_phone_controller,node_sos_controller,node_profile_controller,node_user_service,node_phone_service,node_sos_service,node_twilio toneAmber
class node_auth,node_jwt_filter,node_jwt_util,node_security_config toneMint
class node_users_db,node_phone_db,node_sos_db toneRose
class node_twilio_service toneIndigo
```

## Components

### Angular client

- [App bootstrap](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/main.ts): `frontend/src/main.ts`
- [Page routing](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [App shell](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/app.component.ts): `frontend/src/app/app.component.ts`
- [Login and signup](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/login/login.component.ts): `frontend/src/app/login/login.component.ts`
- [Login API client](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/Services/login.service.ts): `frontend/src/app/Services/login.service.ts`
- [Emergency home](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/home/home.component.ts): `frontend/src/app/home/home.component.ts`
- [Phone number client](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/service/calldb-service.service.ts): `frontend/src/app/service/calldb-service.service.ts`
- [SOS client](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/Services/sos.service.ts): `frontend/src/app/Services/sos.service.ts`
- [User profile](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/profile/profile.component.ts): `frontend/src/app/profile/profile.component.ts`
- [Profile API client](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/Services/use-profile-info.service.ts): `frontend/src/app/Services/use-profile-info.service.ts`
- [Road safety guidance](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/safetyy/safety.component.ts): `frontend/src/app/safetyy/safety.component.ts`
- [About page](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/about/about.component.ts): `frontend/src/app/about/about.component.ts`
- [Call page](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/call/call.component.ts): `frontend/src/app/call/call.component.ts`

### Spring backend

- [Login endpoints](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/LoginController.java): `src/main/java/com/example/demo/controller/LoginController.java`
- [Phone endpoints](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/PhoneNumberController.java): `src/main/java/com/example/demo/controller/PhoneNumberController.java`
- [SOS endpoint](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/SosController.java): `src/main/java/com/example/demo/controller/SosController.java`
- [Profile endpoint](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/controller/UserProfileController.java): `src/main/java/com/example/demo/controller/UserProfileController.java`
- [User service](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/service/UserService.java): `src/main/java/com/example/demo/service/UserService.java`
- [Phone service](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/service/PhoneNumberService.java): `src/main/java/com/example/demo/service/PhoneNumberService.java`
- [SOS service](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/service/SosService.java): `src/main/java/com/example/demo/service/SosService.java`
- [Twilio integration](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/config/TwilioConfig.java): `src/main/java/com/example/demo/config/TwilioConfig.java`

### Identity and security

- [Authentication state](https://github.com/manju-nad-k/accedent-alert-project/blob/main/frontend/src/app/auth.guard.ts): `frontend/src/app/auth.guard.ts`
- [JWT filter](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/security/JwtFilter.java): `src/main/java/com/example/demo/security/JwtFilter.java`
- [JWT utilities](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/security/JwtUtil.java): `src/main/java/com/example/demo/security/JwtUtil.java`
- [Security configuration](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/security/SecurityConfig.java): `src/main/java/com/example/demo/security/SecurityConfig.java`

### Persistence

- [User records](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/repository/UserRepository.java): `src/main/java/com/example/demo/repository/UserRepository.java`
- [Emergency numbers](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/repository/PhoneNumberRepository.java): `src/main/java/com/example/demo/repository/PhoneNumberRepository.java`
- [SOS requests](https://github.com/manju-nad-k/accedent-alert-project/blob/main/src/main/java/com/example/demo/repository/SosRepository.java): `src/main/java/com/example/demo/repository/SosRepository.java`

### Other components

- **App user**
- **Twilio calling service**

## Connections

- App user → Login and signup: signs in
- App bootstrap → App shell: starts (evidence: `frontend/src/main.ts`)
- App bootstrap → Page routing: configures (evidence: `frontend/src/main.ts`)
- Page routing → Login and signup: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Emergency home: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → About page: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Call page: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Road safety guidance: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → User profile: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App shell → Authentication state: uses (evidence: `frontend/src/app/app.component.ts`)
- Login and signup → Login API client: submits credentials (evidence: `frontend/src/app/login/login.component.ts`)
- Login and signup → Authentication state: stores session (evidence: `frontend/src/app/login/login.component.ts`)
- Login API client → Login endpoints: HTTP auth (evidence: `frontend/src/app/Services/login.service.ts`)
- Login endpoints → User service: delegates
- User service → User records: persists users
- Emergency home → Phone number client: loads contact (evidence: `frontend/src/app/home/home.component.ts`)
- Emergency home → SOS client: triggers alert (evidence: `frontend/src/app/home/home.component.ts`)
- Phone number client → Phone endpoints: HTTP phone data (evidence: `frontend/src/app/service/calldb-service.service.ts`)
- Phone endpoints → Phone service: delegates
- Phone service → Emergency numbers: reads and writes
- SOS client → SOS endpoint: HTTP SOS (evidence: `frontend/src/app/Services/sos.service.ts`)
- SOS endpoint → SOS service: delegates
- SOS service → SOS requests: records request
- SOS service → Twilio calling service: places call
- Twilio calling service → Twilio integration: uses configuration
- User profile → Profile API client: loads profile (evidence: `frontend/src/app/profile/profile.component.ts`)
- Profile API client → Profile endpoint: HTTP profile (evidence: `frontend/src/app/Services/use-profile-info.service.ts`)
- Profile endpoint → User service: delegates
- User service → User records: reads and writes
- Security configuration → JWT filter: configures filter
- JWT filter → JWT utilities: checks tokens
