# chikatlasireendra/rakshapay architecture

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

- Interactive diagram: https://gitdiagram.com/chikatlasireendra/rakshapay
- Repository: https://github.com/chikatlasireendra/rakshapay

## Overview

RakshaPay is a scam-safety application for analyzing suspicious messages, payment requests, and call recordings, then reviewing or contributing community scam reports. Users register or sign in, submit evidence to an analyzer, receive risk guidance, and can explore patterns or share incidents. The frontend routes these experiences to a FastAPI backend; message and call analysis can use Gemini, while message analysis includes deterministic fallback logic. Authenticated profile and community actions also use backend APIs, with browser-local data supporting session and demo experiences. Backend route and service wiring is inferred only where imports or calls are evidenced; unsampled routes are not detailed.

Main entry points: [`RakshaPay/src/App.tsx`](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/App.tsx) (App navigation), [`RakshaPay/src/services/apiClient.ts`](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/apiClient.ts) (API client), [`RakshaPay/backend/routes/api.py`](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/routes/api.py) (API routes), [`RakshaPay/src/services/authService.ts`](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/authService.ts) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User experience"]
  node_app["App navigation<br/>[App.tsx]"]
  node_authpages["Login and registration<br/>[LoginPage.tsx]"]
  node_messagepage["Message analyzer"]
  node_paymentpage["Payment analyzer"]
  node_callpage["Call analyzer<br/>[CallAnalyzer.tsx]"]
  node_reportpage["Report scam<br/>[ReportScamPage.tsx]"]
  node_communitypage["Community feed"]
  node_intelligencepage["Scam intelligence"]
  node_dashboard["User dashboard"]
end

subgraph group_analysis["Scam analysis"]
  node_messageanalysis["Message analysis"]
  node_gemini["Gemini analysis<br/>[gemini_service.py]"]
  node_callservice["Call analysis"]
  node_paymentservice["Payment analysis"]
end

subgraph group_community["Community intelligence"]
  node_communityservice["Community reports"]
  node_communitygroups["Community groups"]
end

subgraph group_backend["Backend services"]
  node_api["API client<br/>[apiClient.ts]"]
  node_routes["API routes<br/>[api.py]"]
  node_server["FastAPI application<br/>[main.py]"]
  node_firestore[("Firestore<br/>[firestore.py]")]
  node_storage[("Backend store<br/>[store.py]")]
end

subgraph group_state["User state"]
  node_auth["Authentication service<br/>[authService.ts]"]
  node_localauth["Local session"]
  node_userdata["User data<br/>[userDataService.ts]"]
end

node_person(("User"))
node_geminisvc{{"Gemini API"}}

node_person -->|"uses"| node_app
node_app -->|"renders"| node_authpages
node_app -->|"renders"| node_messagepage
node_app -->|"renders"| node_paymentpage
node_app -->|"renders"| node_callpage
node_app -->|"renders"| node_reportpage
node_app -->|"renders"| node_communitypage
node_app -->|"renders"| node_intelligencepage
node_app -->|"renders"| node_dashboard
node_authpages -->|"authenticates"| node_auth
node_auth -->|"requests"| node_api
node_auth -->|"persists session"| node_localauth
node_app -->|"checks session"| node_auth
node_messagepage -->|"submits analysis"| node_api
node_paymentpage -->|"analyzes payment"| node_paymentservice
node_callpage -->|"analyzes recording"| node_callservice
node_reportpage -->|"submits report"| node_communityservice
node_communitypage -->|"loads reports"| node_communityservice
node_communitypage -->|"loads groups"| node_communitygroups
node_dashboard -->|"loads user data"| node_userdata
node_api -->|"HTTP requests"| node_server
node_server -->|"dispatches"| node_routes
node_routes -->|"analyzes message"| node_messageanalysis
node_messageanalysis -.->|"requests analysis"| node_gemini
node_gemini -.->|"returns analysis"| node_messageanalysis
node_routes -->|"reads and writes"| node_firestore
node_routes -->|"reads and writes"| node_storage
node_communityservice -->|"report actions"| node_api
node_callservice -->|"uploads recording"| node_api
node_paymentservice -->|"submits payment"| node_api

click node_app "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/App.tsx"
click node_authpages "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/LoginPage.tsx"
click node_messagepage "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/MessageAnalyzer.tsx"
click node_paymentpage "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/PaymentAnalyzer.tsx"
click node_callpage "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/CallAnalyzer.tsx"
click node_reportpage "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/ReportScamPage.tsx"
click node_communitypage "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/CommunityFeedPage.tsx"
click node_intelligencepage "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/ScamIntelligencePage.tsx"
click node_dashboard "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/UserDashboardHome.tsx"
click node_api "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/apiClient.ts"
click node_auth "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/authService.ts"
click node_localauth "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/authServiceLocal.ts"
click node_userdata "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/userDataService.ts"
click node_messageanalysis "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/services/analysis_service.py"
click node_gemini "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/services/gemini_service.py"
click node_callservice "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/callAnalysisService.ts"
click node_paymentservice "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/paymentAnalysisService.ts"
click node_communityservice "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/communityService.ts"
click node_communitygroups "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/communityGroupsService.ts"
click node_routes "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/routes/api.py"
click node_server "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/main.py"
click node_firestore "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/firebase/firestore.py"
click node_storage "https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/store.py"

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_authpages,node_messagepage,node_paymentpage,node_callpage,node_reportpage,node_communitypage,node_intelligencepage,node_dashboard,node_person toneBlue
class node_messageanalysis,node_gemini,node_callservice,node_paymentservice toneAmber
class node_communityservice,node_communitygroups,node_geminisvc toneMint
class node_api,node_routes,node_server,node_firestore,node_storage toneRose
class node_auth,node_localauth,node_userdata toneIndigo
```

## Components

### User experience

- [App navigation](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/App.tsx): `RakshaPay/src/App.tsx`
- [Login and registration](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/LoginPage.tsx): `RakshaPay/src/pages/LoginPage.tsx`
- [Message analyzer](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/MessageAnalyzer.tsx): `RakshaPay/src/pages/MessageAnalyzer.tsx`
- [Payment analyzer](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/PaymentAnalyzer.tsx): `RakshaPay/src/pages/PaymentAnalyzer.tsx`
- [Call analyzer](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/CallAnalyzer.tsx): `RakshaPay/src/pages/CallAnalyzer.tsx`
- [Report scam](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/ReportScamPage.tsx): `RakshaPay/src/pages/ReportScamPage.tsx`
- [Community feed](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/CommunityFeedPage.tsx): `RakshaPay/src/pages/CommunityFeedPage.tsx`
- [Scam intelligence](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/ScamIntelligencePage.tsx): `RakshaPay/src/pages/ScamIntelligencePage.tsx`
- [User dashboard](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/pages/UserDashboardHome.tsx): `RakshaPay/src/pages/UserDashboardHome.tsx`

### Scam analysis

- [Message analysis](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/services/analysis_service.py): `RakshaPay/backend/services/analysis_service.py`
- [Gemini analysis](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/services/gemini_service.py): `RakshaPay/backend/services/gemini_service.py`
- [Call analysis](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/callAnalysisService.ts): `RakshaPay/src/services/callAnalysisService.ts`
- [Payment analysis](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/paymentAnalysisService.ts): `RakshaPay/src/services/paymentAnalysisService.ts`

### Community intelligence

- [Community reports](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/communityService.ts): `RakshaPay/src/services/communityService.ts`
- [Community groups](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/communityGroupsService.ts): `RakshaPay/src/services/communityGroupsService.ts`

### Backend services

- [API client](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/apiClient.ts): `RakshaPay/src/services/apiClient.ts`
- [API routes](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/routes/api.py): `RakshaPay/backend/routes/api.py`
- [FastAPI application](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/main.py): `RakshaPay/backend/main.py`
- [Firestore](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/firebase/firestore.py): `RakshaPay/backend/firebase/firestore.py`
- [Backend store](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/backend/store.py): `RakshaPay/backend/store.py`

### User state

- [Authentication service](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/authService.ts): `RakshaPay/src/services/authService.ts`
- [Local session](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/authServiceLocal.ts): `RakshaPay/src/services/authServiceLocal.ts`
- [User data](https://github.com/chikatlasireendra/rakshapay/blob/main/RakshaPay/src/services/userDataService.ts): `RakshaPay/src/services/userDataService.ts`

### Other components

- **User**
- **Gemini API**

## Connections

- User → App navigation: uses
- App navigation → Login and registration: renders
- App navigation → Message analyzer: renders
- App navigation → Payment analyzer: renders
- App navigation → Call analyzer: renders
- App navigation → Report scam: renders
- App navigation → Community feed: renders
- App navigation → Scam intelligence: renders
- App navigation → User dashboard: renders
- Login and registration → Authentication service: authenticates
- Authentication service → API client: requests
- Authentication service → Local session: persists session
- App navigation → Authentication service: checks session
- Message analyzer → API client: submits analysis
- Payment analyzer → Payment analysis: analyzes payment
- Call analyzer → Call analysis: analyzes recording
- Report scam → Community reports: submits report
- Community feed → Community reports: loads reports
- Community feed → Community groups: loads groups
- User dashboard → User data: loads user data
- API client → FastAPI application: HTTP requests
- FastAPI application → API routes: dispatches
- API routes → Message analysis: analyzes message
- Message analysis → Gemini analysis: requests analysis
- Gemini analysis → Message analysis: returns analysis
- API routes → Firestore: reads and writes
- API routes → Backend store: reads and writes
- Community reports → API client: report actions
- Call analysis → API client: uploads recording
- Payment analysis → API client: submits payment
