# walkerbuddy01/raay architecture

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

- Interactive diagram: https://gitdiagram.com/walkerbuddy01/raay
- Repository: https://github.com/walkerbuddy01/raay

## Overview

##### Main System Components

a) Client Layer:
- Next.js 14 Frontend (App Router based)
- Protected Routes (/d/*)
- Public Routes (auth, anonymous feedback)
- UI Components (ShadCN UI, Aceternity UI)

b) Server Layer:
- Next.js Server Components
- Server Actions (src/actions/*)
- Authentication System (AuthJS)
- Email Service (mail system)

c) Data Layer:
- Prisma ORM
- Database (likely PostgreSQL based on Prisma usage)
- File Storage (UploadThing integration)

##### Architectural Patterns to Highlight

a) Route Groups Organization:
- (feedback) - Anonymous feedback routes
- (protected) - Dashboard routes
- (auth) - Authentication routes

b) Feature Modules:
- Feeder Management
- Feedback Collection
- User Authentication
- Settings Management

##### Specific Implementation Details

a) Authentication Flow:
- Sign In/Sign Up processes
- Password Reset flow
- Email verification system

b) Data Flow:
- Server Actions → Database
- Client → Server Communication
- File Upload Pipeline

##### Key Relationships

- Frontend → Server Actions
- Server Actions → Database
- Authentication → Protected Routes
- File Upload → Storage Service

- Client Layer       |
- (Next.js Frontend)    |

- ↕

- Server Layer       |
- (Server Actions/Auth) |

- ↕

- Data Layer        |
- (Prisma/Database)     |

##### Important Technical Details

- TypeScript integration
- Prisma Schema relationships
- Authentication middleware
- Route protection mechanisms
- Server Action endpoints
- Email service integration

##### External Services Integration

Connections to:
- Email Service
- UploadThing
- Authentication Providers

This structure will effectively communicate both the overall system architecture and the specific implementation details of RAAY's feedback platform.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Frontend["Next.js 14 Frontend"]
        ProtectedRoutes["/d/* Routes"]:::protected
        PublicRoutes["Public Routes"]:::public
        UIComponents["UI Components"]:::ui
    end

    subgraph Server
        ServerComponents["Server Components"]:::server
        ServerActions["Server Actions"]:::server
        AuthSystem["Authentication System"]:::auth
        EmailService["Email Service"]:::service
    end

    subgraph Data
        PrismaORM["Prisma ORM"]:::data
        Database[(Database)]:::data
        FileStorage["UploadThing Storage"]:::storage
    end

    %% Connections
    Frontend --> ServerComponents
    Frontend --> ServerActions
    ProtectedRoutes --> AuthSystem
    PublicRoutes --> ServerActions
    ServerComponents --> PrismaORM
    ServerActions --> PrismaORM
    PrismaORM --> Database
    AuthSystem --> Database
    EmailService --> ServerActions
    UIComponents --> ServerActions
    ServerActions --> FileStorage

    %% Click Events
    click ProtectedRoutes "https://github.com/walkerbuddy01/RAAY/tree/main/src/app/(protected)"
    click PublicRoutes "https://github.com/walkerbuddy01/RAAY/tree/main/src/app/(feedback)"
    click UIComponents "https://github.com/walkerbuddy01/RAAY/tree/main/src/components/ui"
    click ServerActions "https://github.com/walkerbuddy01/RAAY/tree/main/src/actions"
    click AuthSystem "https://github.com/walkerbuddy01/RAAY/blob/main/src/auth.ts"
    click EmailService "https://github.com/walkerbuddy01/RAAY/blob/main/src/lib/mail.ts"
    click PrismaORM "https://github.com/walkerbuddy01/RAAY/blob/main/prisma/schema.prisma"
    click FileStorage "https://github.com/walkerbuddy01/RAAY/blob/main/src/lib/uploadthing.ts"

    %% Styles
    classDef protected fill:#6366f1,color:white
    classDef public fill:#22c55e,color:white
    classDef ui fill:#0ea5e9,color:white
    classDef server fill:#84cc16,color:white
    classDef auth fill:#f43f5e,color:white
    classDef service fill:#a855f7,color:white
    classDef data fill:#eab308,color:black
    classDef storage fill:#f97316,color:white

    %% Legend
    subgraph Legend
        L1[Protected Routes]:::protected
        L2[Public Routes]:::public
        L3[UI Components]:::ui
        L4[Server Components]:::server
        L5[Authentication]:::auth
        L6[Services]:::service
        L7[Data Layer]:::data
        L8[Storage]:::storage
    end
```
