# malikyakub/mk-passes architecture

> Architecture diagram of the GitHub repository malikyakub/mk-passes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/malikyakub/mk-passes
- Repository: https://github.com/malikyakub/mk-passes

## Overview

##### Project type and purpose
- This is a full-stack, cross-platform mobile application built with Expo/React Native (android/ and ios/ folders, metro.config.js, index.js, app/ screens, components/, hooks/).
- It also includes a small Node.js “backend” (backend/server.js) alongside a Supabase-backed database (utils/supabase.js).
- Purpose: a password-generator and message-encrypter app featuring user authentication, CRUD for saved passwords, and message encryption/decryption.

##### File structure
- Top-level:
- android/, ios/ → native build artifacts and configurations for Android and iOS
- app/ → Expo Router directory: each .tsx/.jsx file is a screen or layout in the navigation tree
- components/ → reusable UI pieces (cards, headers, navigation controls)
- hooks/ → custom React hooks handling auth (useAuth), data (usePasswords, useUsers), font loading (useL-Fam)
- utils/ → supabase.js for initializing the Supabase client
- backend/ → Node.js API (server.js + package.json) that may offer custom endpoints or middleware beyond Supabase
- Build & deployment:
- app.json, eas.json → Expo config & build profiles
- .github/workflows/codeql.yml → CI/CodeQL scanning
- tsconfig.json, package.json → TypeScript & dependency management

##### README
- Confirms: “Mk-passes – password generator and message encrypter”
- No additional architecture notes; everything is implicit in the folder layout.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Mobile Application"    
        direction TB
        UI["Expo Router UI\n(app/)"]:::client
        Components["Reusable UI Components\n(components/)"]:::client
        Business["Business Logic Hooks\n(hooks/)"]:::client
        Data["Supabase Client\n(utils/supabase.js)"]:::client
        Encryption["Encryption & Password Modules\n(assets/models/)"]:::client
    end

    %% API Layer
    API["Node.js API Service\n(backend/server.js)"]:::backend

    %% External Services
    subgraph "Supabase Services"
        direction TB
        SupabaseAuth["Supabase Auth"]:::external
        SupabaseDB["Supabase Postgres DB"]:::external
    end

    %% Deployment & Config
    NativeTargets["Native Build Targets\n(android/, ios/)"]:::external
    Config["Config & Build Profiles\n(app.json,\neas.json,\nmetro.config.js,\ntsconfig.json,\npackage.json,\npackage-lock.json,\n.github/workflows/codeql.yml)"]:::external

    %% Relationships
    UI -->|uses| Components
    UI -->|invokes| Business
    Business -->|calls| Data
    Data -->|connects to| SupabaseDB
    Data -->|authenticates via| SupabaseAuth
    UI -->|uses| Encryption
    Encryption -->|passes data to| Business

    UI -->|API calls| API
    API -->|queries| SupabaseDB
    API -->|auth via| SupabaseAuth

    UI -->|builds to| NativeTargets
    Config -->|configures| UI
    Config -->|configures| API

    %% Click Events
    click UI "https://github.com/malikyakub/mk-passes/tree/main/app/"
    click Components "https://github.com/malikyakub/mk-passes/tree/main/components/"
    click Business "https://github.com/malikyakub/mk-passes/tree/main/hooks/"
    click Data "https://github.com/malikyakub/mk-passes/blob/main/utils/supabase.js"
    click Encryption "https://github.com/malikyakub/mk-passes/tree/main/assets/models/"
    click API "https://github.com/malikyakub/mk-passes/blob/main/backend/server.js"

    %% Styles
    classDef client fill:#D0E8FF,stroke:#66A3FF,color:#000
    classDef backend fill:#D0FFD0,stroke:#33CC33,color:#000
    classDef external fill:#FFE8A0,stroke:#FFB300,color:#000
```
