# hazqeel09/getdoav3 architecture

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

- Interactive diagram: https://gitdiagram.com/hazqeel09/getdoav3
- Repository: https://github.com/hazqeel09/getdoav3

## Overview

##### Main System Components

a) Frontend Layer:
- Remix application (React-based)
- UI Components (shadcn/ui based on the components structure)
- Client-side routing

b) Backend Layer:
- Remix Server
- Authentication Service (OAuth with Google)
- API Routes (RESTful endpoints)
- Database Service (Prisma ORM)

c) Database Layer:
- PostgreSQL (indicated by Prisma schema)
- Migrations management

d) External Services:
- Google OAuth
- SedekahJe Integration

##### Component Relationships

a) Client-Server Flow:
- Browser → Remix Server → Database
- Authentication flow with Google OAuth
- API endpoints for CRUD operations

b) Data Flow:
- User interactions → API Routes → Database
- Authentication flow → Session management
- Bookmarks and compilations management

##### Specific Architectural Elements

Key architectural patterns:

a) Frontend Architecture:
**Components/**
- UI/ (reusable components)
- create-doa/
- dynamicDoa/
- home/

b) API Structure:
**api.v1/**
- bookmarks/
- compilations/
- doas/
- user/

##### Key Features to Highlight

Core functionalities:
- OAuth authentication flow
- Doa management system
- Bookmark and compilation features
- QR code generation and sharing
- API endpoints for external integration

##### Technical Stack Indicators

Technology badges for:
- Remix
- React
- Prisma
- PostgreSQL
- TypeScript
- Tailwind CSS

##### Deployment Flow

Deployment pipeline:
- GitHub Actions workflows
- Docker containerization
- Environment configuration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Browser/Client"]:::client
        UI["UI Components"]:::frontend
        click UI "https://github.com/Hazqeel09/getdoav3/tree/main/remix/app/components/ui/"
        ClientEntry["Client Entry"]:::frontend
        click ClientEntry "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/entry.client.tsx"
        QR["QR Code Generator"]:::frontend
        click QR "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/components/dynamicDoa/qrCode.tsx"
    end

    subgraph "Server Layer"
        RemixServer["Remix Server"]:::server
        ServerEntry["Server Entry"]:::server
        click ServerEntry "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/entry.server.tsx"
        
        subgraph "Core Services"
            AuthService["Authentication Service"]:::service
            click AuthService "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/services/auth.server.ts"
            SessionMgmt["Session Management"]:::service
            click SessionMgmt "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/libs/session.server.ts"
            OAuth["OAuth Integration"]:::service
            click OAuth "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/libs/oauth2.server.ts"
            EnvConfig["Environment Config"]:::service
            click EnvConfig "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/libs/env.server.ts"
        end

        subgraph "Business Services"
            DoaService["Doa Management"]:::service
            click DoaService "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/services/doa.server.ts"
            BookmarkService["Bookmark Service"]:::service
            click BookmarkService "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/services/bookmark.server.ts"
            CompilationService["Compilation Service"]:::service
            click CompilationService "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/services/compilation.server.ts"
        end

        subgraph "API Layer"
            APIRoutes["API Routes"]:::api
            click APIRoutes "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/routes/api.v1.*"
            TypeDefs["Type Definitions"]:::code
            click TypeDefs "https://github.com/Hazqeel09/getdoav3/tree/main/remix/app/types/"
            DataSchemas["Data Schemas"]:::code
            click DataSchemas "https://github.com/Hazqeel09/getdoav3/tree/main/remix/app/schemas/"
        end
    end

    subgraph "Database Layer"
        DBService["Database Service"]:::database
        click DBService "https://github.com/Hazqeel09/getdoav3/blob/main/remix/app/libs/prisma.server.ts"
        PostgreSQL["PostgreSQL"]:::database
        DBSchema["Database Schema"]:::database
        click DBSchema "https://github.com/Hazqeel09/getdoav3/blob/main/remix/prisma/schema.prisma"
        DBMigrations["Migrations"]:::database
        click DBMigrations "https://github.com/Hazqeel09/getdoav3/tree/main/remix/prisma/migrations/"
    end

    subgraph "External Services"
        GoogleOAuth["Google OAuth"]:::external
        SedekahJe["SedekahJe Integration"]:::external
    end

    subgraph "DevOps"
        GithubActions["GitHub Actions"]:::devops
        click GithubActions "https://github.com/Hazqeel09/getdoav3/tree/main/.github/workflows/"
        Docker["Docker Container"]:::devops
        Assets["Public Assets"]:::static
        click Assets "https://github.com/Hazqeel09/getdoav3/tree/main/remix/public/"
    end

    %% Relationships
    Browser --> UI
    UI --> ClientEntry
    UI --> QR
    Browser --> RemixServer
    RemixServer --> ServerEntry
    RemixServer --> AuthService
    RemixServer --> APIRoutes
    AuthService --> OAuth
    OAuth --> GoogleOAuth
    AuthService --> SessionMgmt
    APIRoutes --> DoaService
    APIRoutes --> BookmarkService
    APIRoutes --> CompilationService
    DoaService --> DBService
    BookmarkService --> DBService
    CompilationService --> DBService
    DBService --> PostgreSQL
    PostgreSQL --> DBSchema
    PostgreSQL --> DBMigrations
    RemixServer --> EnvConfig
    APIRoutes --> TypeDefs
    APIRoutes --> DataSchemas
    RemixServer --> SedekahJe

    %% Styles
    classDef client fill:#E1F5FE,stroke:#0288D1
    classDef frontend fill:#BBDEFB,stroke:#1976D2
    classDef server fill:#C8E6C9,stroke:#388E3C
    classDef service fill:#A5D6A7,stroke:#2E7D32
    classDef api fill:#FFF9C4,stroke:#FBC02D
    classDef database fill:#E1BEE7,stroke:#7B1FA2
    classDef external fill:#FFE0B2,stroke:#F57C00
    classDef devops fill:#FFCDD2,stroke:#D32F2F
    classDef static fill:#B2EBF2,stroke:#0097A7
    classDef code fill:#F5F5F5,stroke:#616161
```
