# mohamedarman/unimo architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedarman/unimo
- Repository: https://github.com/mohamedarman/unimo

## Overview

This repository is an Android multi-account Google Drive file manager, despite the README describing a React rewrite; the available source tree and excerpts are Android/Kotlin. Its intended user journey spans account authorization, account-scoped file access and management, and local metadata/token persistence. The excerpts show application wiring, repositories, provider operations, and storage, but do not establish screen-to-workflow calls. README-only capabilities such as quota governance, action resolution, and redaction are retained as documented subsystems, with uncertain implementation paths and links omitted.

Main entry points: [`app/src/main/java/unimo/core/UnimoApplication.kt`](https://github.com/mohamedarman/unimo/blob/master/app/src/main/java/unimo/core/UnimoApplication.kt) (App startup), [`data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt`](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt) (Room database), [`core/src/main/kotlin/unimo/core/AppContainer.kt`](https://github.com/mohamedarman/unimo/blob/master/core/src/main/kotlin/unimo/core/AppContainer.kt) (Dependency container), [`cloud/src/main/kotlin/unimo/cloud/google/GoogleDriveProvider.kt`](https://github.com/mohamedarman/unimo/blob/master/cloud/src/main/kotlin/unimo/cloud/google/GoogleDriveProvider.kt) (Google Drive provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Android experience"]
  node_onboarding["Onboarding"]
  node_account_gate["Account gate"]
  node_home["File gallery<br/>[HomeScreen.kt]"]
  node_splash["Splash screen<br/>[SplashScreen.kt]"]
end

subgraph group_application["Application wiring"]
  node_application["App startup"]
  node_auth["Google authorization"]
  node_container["Dependency container<br/>[AppContainer.kt]"]
  node_quota_governor["Quota governor"]
  node_redaction["Security redaction"]
end

subgraph group_domain_cloud["Domain and Drive"]
  node_drive["Google Drive provider"]
  node_provider_contract["Provider operations<br/>[CloudProvider.kt]"]
  node_file_identity["Account-scoped file identity<br/>[FileRef.kt]"]
  node_cloud_file["Cloud file metadata<br/>[CloudFile.kt]"]
  node_connected_account["Connected account model"]
  node_token_model["Token model<br/>[TokenSet.kt]"]
  node_errors["Normalized errors<br/>[AppError.kt]"]
  node_action_resolution["File action resolution"]
end

subgraph group_persistence["Local persistence"]
  node_accounts["Account lifecycle"]
  node_files["File metadata access<br/>[FileRepository.kt]"]
  node_token_store[("Encrypted tokens<br/>[TokenStore.kt]")]
  node_database[("Room database<br/>[UnimoDatabase.kt]")]
  node_account_dao["Account records"]
  node_file_dao["File metadata records<br/>[FileMetadataDao.kt]"]
  node_pending_dao["Pending operations"]
  node_write_queue["Durable write queue"]
end

node_user(("User"))
node_google(("Google OAuth and Drive"))

node_application -->|"initializes"| node_container
node_application -->|"initializes"| node_database
node_application -->|"wires"| node_accounts
node_application -->|"wires"| node_files
node_application -->|"wires"| node_token_store
node_application -->|"wires"| node_drive
node_container -->|"provides"| node_accounts
node_container -->|"provides"| node_files
node_container -->|"provides"| node_token_store
node_container -->|"provides"| node_drive
node_auth -->|"deletes tokens"| node_token_store
node_accounts -->|"reads and writes"| node_database
node_accounts -->|"deletes tokens"| node_token_store
node_files -->|"reads and writes"| node_database
node_database -->|"exposes"| node_account_dao
node_database -->|"exposes"| node_file_dao
node_database -->|"exposes"| node_pending_dao
node_drive -->|"requests Drive API"| node_google
node_drive -->|"implements"| node_provider_contract
node_user -.->|"starts setup"| node_onboarding
node_user -.->|"manages accounts"| node_account_gate
node_user -.->|"browses files"| node_home
node_account_gate -.->|"authorizes"| node_auth
node_quota_governor -.->|"limits requests"| node_drive
node_action_resolution -.->|"resolves actions"| node_provider_contract
node_write_queue -.->|"persists operations"| node_pending_dao

click node_onboarding "https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/onboarding/OnboardingScreen.kt"
click node_account_gate "https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/account/AccountGateScreen.kt"
click node_home "https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/home/HomeScreen.kt"
click node_splash "https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/splash/SplashScreen.kt"
click node_application "https://github.com/mohamedarman/unimo/blob/master/app/src/main/java/unimo/core/UnimoApplication.kt"
click node_auth "https://github.com/mohamedarman/unimo/blob/master/app/src/main/java/unimo/core/GoogleAuthClient.kt"
click node_container "https://github.com/mohamedarman/unimo/blob/master/core/src/main/kotlin/unimo/core/AppContainer.kt"
click node_accounts "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/repository/AccountRepository.kt"
click node_files "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/repository/FileRepository.kt"
click node_token_store "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/cache/TokenStore.kt"
click node_database "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt"
click node_account_dao "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/ConnectedAccountDao.kt"
click node_file_dao "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/FileMetadataDao.kt"
click node_pending_dao "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/PendingOperationDao.kt"
click node_drive "https://github.com/mohamedarman/unimo/blob/master/cloud/src/main/kotlin/unimo/cloud/google/GoogleDriveProvider.kt"
click node_provider_contract "https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/CloudProvider.kt"
click node_file_identity "https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/FileRef.kt"
click node_cloud_file "https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/CloudFile.kt"
click node_connected_account "https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/ConnectedAccount.kt"
click node_token_model "https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/TokenSet.kt"
click node_errors "https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/AppError.kt"
click node_write_queue "https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/PendingOperationDao.kt"

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_onboarding,node_account_gate,node_home,node_splash,node_user toneBlue
class node_application,node_auth,node_container,node_quota_governor,node_redaction toneAmber
class node_drive,node_provider_contract,node_file_identity,node_cloud_file,node_connected_account,node_token_model,node_errors,node_action_resolution toneMint
class node_accounts,node_files,node_token_store,node_database,node_account_dao,node_file_dao,node_pending_dao,node_write_queue toneRose
class node_google toneIndigo
```

## Components

### Android experience

- [Onboarding](https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/onboarding/OnboardingScreen.kt): `app/src/main/kotlin/unimo/ui/onboarding/OnboardingScreen.kt`
- [Account gate](https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/account/AccountGateScreen.kt): `app/src/main/kotlin/unimo/ui/account/AccountGateScreen.kt`
- [File gallery](https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/home/HomeScreen.kt): `app/src/main/kotlin/unimo/ui/home/HomeScreen.kt`
- [Splash screen](https://github.com/mohamedarman/unimo/blob/master/app/src/main/kotlin/unimo/ui/splash/SplashScreen.kt): `app/src/main/kotlin/unimo/ui/splash/SplashScreen.kt`

### Application wiring

- [App startup](https://github.com/mohamedarman/unimo/blob/master/app/src/main/java/unimo/core/UnimoApplication.kt): `app/src/main/java/unimo/core/UnimoApplication.kt`
- [Google authorization](https://github.com/mohamedarman/unimo/blob/master/app/src/main/java/unimo/core/GoogleAuthClient.kt): `app/src/main/java/unimo/core/GoogleAuthClient.kt`
- [Dependency container](https://github.com/mohamedarman/unimo/blob/master/core/src/main/kotlin/unimo/core/AppContainer.kt): `core/src/main/kotlin/unimo/core/AppContainer.kt`
- **Quota governor**
- **Security redaction**

### Domain and Drive

- [Google Drive provider](https://github.com/mohamedarman/unimo/blob/master/cloud/src/main/kotlin/unimo/cloud/google/GoogleDriveProvider.kt): `cloud/src/main/kotlin/unimo/cloud/google/GoogleDriveProvider.kt`
- [Provider operations](https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/CloudProvider.kt): `domain/src/main/kotlin/unimo/domain/CloudProvider.kt`
- [Account-scoped file identity](https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/FileRef.kt): `domain/src/main/kotlin/unimo/domain/FileRef.kt`
- [Cloud file metadata](https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/CloudFile.kt): `domain/src/main/kotlin/unimo/domain/CloudFile.kt`
- [Connected account model](https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/ConnectedAccount.kt): `domain/src/main/kotlin/unimo/domain/ConnectedAccount.kt`
- [Token model](https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/TokenSet.kt): `domain/src/main/kotlin/unimo/domain/TokenSet.kt`
- [Normalized errors](https://github.com/mohamedarman/unimo/blob/master/domain/src/main/kotlin/unimo/domain/AppError.kt): `domain/src/main/kotlin/unimo/domain/AppError.kt`
- **File action resolution**

### Local persistence

- [Account lifecycle](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/repository/AccountRepository.kt): `data/src/main/kotlin/unimo/data/repository/AccountRepository.kt`
- [File metadata access](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/repository/FileRepository.kt): `data/src/main/kotlin/unimo/data/repository/FileRepository.kt`
- [Encrypted tokens](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/cache/TokenStore.kt): `data/src/main/kotlin/unimo/data/cache/TokenStore.kt`
- [Room database](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt): `data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt`
- [Account records](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/ConnectedAccountDao.kt): `data/src/main/kotlin/unimo/data/database/dao/ConnectedAccountDao.kt`
- [File metadata records](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/FileMetadataDao.kt): `data/src/main/kotlin/unimo/data/database/dao/FileMetadataDao.kt`
- [Pending operations](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/PendingOperationDao.kt): `data/src/main/kotlin/unimo/data/database/dao/PendingOperationDao.kt`
- [Durable write queue](https://github.com/mohamedarman/unimo/blob/master/data/src/main/kotlin/unimo/data/database/dao/PendingOperationDao.kt): `data/src/main/kotlin/unimo/data/database/dao/PendingOperationDao.kt`

### Other components

- **User**
- **Google OAuth and Drive**

## Connections

- App startup → Dependency container: initializes (evidence: `app/src/main/java/unimo/core/UnimoApplication.kt`)
- App startup → Room database: initializes (evidence: `app/src/main/java/unimo/core/UnimoApplication.kt`)
- App startup → Account lifecycle: wires (evidence: `app/src/main/java/unimo/core/UnimoApplication.kt`)
- App startup → File metadata access: wires (evidence: `app/src/main/java/unimo/core/UnimoApplication.kt`)
- App startup → Encrypted tokens: wires (evidence: `app/src/main/java/unimo/core/UnimoApplication.kt`)
- App startup → Google Drive provider: wires (evidence: `app/src/main/java/unimo/core/UnimoApplication.kt`)
- Dependency container → Account lifecycle: provides (evidence: `core/src/main/kotlin/unimo/core/AppContainer.kt`)
- Dependency container → File metadata access: provides (evidence: `core/src/main/kotlin/unimo/core/AppContainer.kt`)
- Dependency container → Encrypted tokens: provides (evidence: `core/src/main/kotlin/unimo/core/AppContainer.kt`)
- Dependency container → Google Drive provider: provides (evidence: `core/src/main/kotlin/unimo/core/AppContainer.kt`)
- Google authorization → Encrypted tokens: deletes tokens (evidence: `app/src/main/java/unimo/core/GoogleAuthClient.kt`)
- Account lifecycle → Room database: reads and writes (evidence: `data/src/main/kotlin/unimo/data/repository/AccountRepository.kt`)
- Account lifecycle → Encrypted tokens: deletes tokens (evidence: `data/src/main/kotlin/unimo/data/repository/AccountRepository.kt`)
- File metadata access → Room database: reads and writes (evidence: `data/src/main/kotlin/unimo/data/repository/FileRepository.kt`)
- Room database → Account records: exposes (evidence: `data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt`)
- Room database → File metadata records: exposes (evidence: `data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt`)
- Room database → Pending operations: exposes (evidence: `data/src/main/kotlin/unimo/data/database/UnimoDatabase.kt`)
- Google Drive provider → Google OAuth and Drive: requests Drive API (evidence: `cloud/src/main/kotlin/unimo/cloud/google/GoogleDriveProvider.kt`)
- Google Drive provider → Provider operations: implements (evidence: `core/src/main/kotlin/unimo/core/AppContainer.kt`)
- User → Onboarding: starts setup
- User → Account gate: manages accounts
- User → File gallery: browses files
- Account gate → Google authorization: authorizes
- Quota governor → Google Drive provider: limits requests
- File action resolution → Provider operations: resolves actions
- Durable write queue → Pending operations: persists operations (evidence: `data/src/main/kotlin/unimo/data/database/dao/PendingOperationDao.kt`)
