# xun0719/subscription-manager architecture

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

- Interactive diagram: https://gitdiagram.com/xun0719/subscription-manager
- Repository: https://github.com/xun0719/subscription-manager

## Overview

This is a subscription-sharing manager: users view shared platforms, create one with members and an automatically assigned owner, inspect per-member debts, mark payments settled or unsettled, and edit or delete platforms. The React Native screens call the Express API directly; the backend queries SQL Server and invokes a stored procedure for payment toggles. The README is empty, so capabilities and wiring here are based on the supplied source and tree; the SQL definition itself was not sampled.

Main entry points: [`backend/index.js`](https://github.com/xun0719/subscription-manager/blob/main/backend/index.js) (Platform API), [`frontend/screens/DetailsScreen.js`](https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/DetailsScreen.js) (Member debts), [`frontend/App.js`](https://github.com/xun0719/subscription-manager/blob/main/frontend/App.js) (Navigation), [`frontend/screens/EditScreen.js`](https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/EditScreen.js) (Edit or delete)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["Navigation<br/>[App.js]"]
  node_home["Platform list<br/>[HomeScreen.js]"]
  node_add["Create platform<br/>[AddScreen.js]"]
  node_details["Member debts<br/>[DetailsScreen.js]"]
  node_edit["Edit or delete<br/>[EditScreen.js]"]
  node_apiurl["API address<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_server["Platform API<br/>[index.js]"]
end

subgraph group_data["Data storage"]
  node_sql[("Subscription database")]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"shows first"| node_home
node_app -->|"navigates"| node_add
node_app -->|"navigates"| node_details
node_app -->|"navigates"| node_edit
node_home -->|"reads address"| node_apiurl
node_add -->|"reads address"| node_apiurl
node_details -->|"reads address"| node_apiurl
node_edit -->|"reads address"| node_apiurl
node_home -->|"fetches platforms"| node_server
node_add -->|"creates platform"| node_server
node_details -->|"loads debts"| node_server
node_details -->|"toggles payment"| node_server
node_details -->|"deletes platform"| node_server
node_details -->|"opens editor"| node_edit
node_edit -->|"updates platform"| node_server
node_edit -->|"deletes platform"| node_server
node_server -->|"queries and updates"| node_sql

click node_app "https://github.com/xun0719/subscription-manager/blob/main/frontend/App.js"
click node_home "https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/HomeScreen.js"
click node_add "https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/AddScreen.js"
click node_details "https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/DetailsScreen.js"
click node_edit "https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/EditScreen.js"
click node_apiurl "https://github.com/xun0719/subscription-manager/blob/main/frontend/api.js"
click node_server "https://github.com/xun0719/subscription-manager/blob/main/backend/index.js"
click node_sql "https://github.com/xun0719/subscription-manager/blob/main/database/SubscriptionManager.sql"

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_home,node_add,node_details,node_edit,node_apiurl,node_user toneBlue
class node_server toneAmber
class node_sql toneMint
```

## Components

### Mobile app

- [Navigation](https://github.com/xun0719/subscription-manager/blob/main/frontend/App.js): `frontend/App.js`
- [Platform list](https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/HomeScreen.js): `frontend/screens/HomeScreen.js`
- [Create platform](https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/AddScreen.js): `frontend/screens/AddScreen.js`
- [Member debts](https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/DetailsScreen.js): `frontend/screens/DetailsScreen.js`
- [Edit or delete](https://github.com/xun0719/subscription-manager/blob/main/frontend/screens/EditScreen.js): `frontend/screens/EditScreen.js`
- [API address](https://github.com/xun0719/subscription-manager/blob/main/frontend/api.js): `frontend/api.js`

### Backend API

- [Platform API](https://github.com/xun0719/subscription-manager/blob/main/backend/index.js): `backend/index.js`

### Data storage

- [Subscription database](https://github.com/xun0719/subscription-manager/blob/main/database/SubscriptionManager.sql): `database/SubscriptionManager.sql`

### Other components

- **User**

## Connections

- User → Navigation: opens
- Navigation → Platform list: shows first
- Navigation → Create platform: navigates
- Navigation → Member debts: navigates
- Navigation → Edit or delete: navigates
- Platform list → API address: reads address
- Create platform → API address: reads address
- Member debts → API address: reads address
- Edit or delete → API address: reads address
- Platform list → Platform API: fetches platforms
- Create platform → Platform API: creates platform
- Member debts → Platform API: loads debts
- Member debts → Platform API: toggles payment
- Member debts → Platform API: deletes platform
- Member debts → Edit or delete: opens editor
- Edit or delete → Platform API: updates platform
- Edit or delete → Platform API: deletes platform
- Platform API → Subscription database: queries and updates
