# rs-labhub/festigo architecture

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

- Interactive diagram: https://gitdiagram.com/rs-labhub/festigo
- Repository: https://github.com/rs-labhub/festigo

## Overview

##### Main Components

a. Frontend Layer:
- Client-side Components (Next.js Pages and Components)
- Authentication Views (/auth)
- Dashboard Views (/dashboard)
- Home Page Components
- Common Components (forms, buttons, modals)

b. Backend Layer:
- API Routes (/api)
- Authentication Services
- Event Management
- Chat/Communication Services
- Vendor Management
- Guest Management
- Payment Processing
- Venue Management

c. Database Layer:
- Prisma ORM
- Database Tables (based on schema.prisma)
- Users
- Events
- Vendors
- Guests
- Channels
- Messages
- Venues
- Payments

##### Architecture Pattern Representation

**[Client Layer (Next.js Frontend)]**
- ↕
**[API Layer (Next.js API Routes)]**
- ↕
**[Database Layer (Prisma + DB)]**

##### Key Relationships to Highlight

- User Authentication Flow
- Event Management Flow
- Communication Systems (Chat/Channels)
- Payment Processing
- Guest Management and RSVP System

**[Frontend Layer]**
- Public Pages
- Home, About, Features
- Auth Pages
- Login, Signup, Password Reset
- Dashboard
- Event Management
- Calendar
- Chat Room
- Floor Planning
- Guest Management
- Vendor Management

**[API Layer]**
- Auth Services
- Event Services
- Chat Services
- Guest Services
- Vendor Services
- Payment Services

**[Database Layer]**
- All Prisma Models

##### Additional Elements

- WebSocket connections for real-time features (chat)
- Email service integration (Utils/sendMail.ts)
- Authentication flow
- File storage for assets

##### Important Flows

- User authentication flow
- Event creation and management flow
- Guest invitation and RSVP flow
- Vendor management flow
- Payment processing flow
- Real-time communication flow

##### Technical Stack Indicators

- Next.js
- Prisma ORM
- TypeScript
- Tailwind CSS
- Email Service
- Payment Gateway

This system design should effectively communicate the application's architecture while highlighting its event planning-specific features and real-time communication capabilities.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        PublicPages["Public Pages"]
        AuthPages["Authentication Pages"]:::auth
        DashboardPages["Dashboard Pages"]:::dashboard
        CommonComps["Common Components"]:::common
        
        subgraph PublicPages
            Home["Home Page"]:::home
            Features["Features"]:::home
            AboutUs["About Us"]:::home
        end
        
        subgraph AuthPages
            Login["Login"]:::auth
            Signup["Signup"]:::auth
            Reset["Password Reset"]:::auth
        end
        
        subgraph DashboardPages
            Calendar["Calendar"]:::dashboard
            ChatRoom["Chat Room"]:::dashboard
            FloorPlan["Floor Planning"]:::dashboard
            GuestMgmt["Guest Management"]:::dashboard
            VendorMgmt["Vendor Management"]:::dashboard
            PaymentSys["Payment System"]:::dashboard
        end
        
        subgraph CommonComps
            Button["Button"]:::common
            Modal["Modal"]:::common
            Input["Input Field"]:::common
            EventForm["Event Form"]:::common
        end
    end
    
    subgraph APILayer
        AuthAPI["Authentication API"]:::api
        EventAPI["Event API"]:::api
        ChatAPI["Chat API"]:::api
        GuestAPI["Guest API"]:::api
        VendorAPI["Vendor API"]:::api
        PaymentAPI["Payment API"]:::api
        VenueAPI["Venue API"]:::api
        ChannelAPI["Channel API"]:::api
    end
    
    subgraph DatabaseLayer
        PrismaORM["Prisma ORM"]:::db
        DBConn["Database Connection"]:::db
        
        subgraph Models
            Users[(Users)]:::model
            Events[(Events)]:::model
            Vendors[(Vendors)]:::model
            Guests[(Guests)]:::model
            Channels[(Channels)]:::model
            Messages[(Messages)]:::model
            Venues[(Venues)]:::model
            Payments[(Payments)]:::model
        end
    end
    
    subgraph ExternalServices
        EmailService{{"Email Service"}}:::external
        PaymentGateway{{"Payment Gateway"}}:::external
    end
    
    %% Relationships
    PublicPages --> AuthPages
    AuthPages --> DashboardPages
    DashboardPages --> CommonComps
    
    DashboardPages --> APILayer
    APILayer --> DatabaseLayer
    APILayer --> ExternalServices
    
    %% Click Events
    click Login "https://github.com/RS-labhub/festigo/tree/main/app/auth/login"
    click Signup "https://github.com/RS-labhub/festigo/tree/main/app/auth/signup"
    click Reset "https://github.com/RS-labhub/festigo/tree/main/app/auth/resetPassword"
    click Calendar "https://github.com/RS-labhub/festigo/tree/main/app/(dashboard)/calender"
    click ChatRoom "https://github.com/RS-labhub/festigo/tree/main/app/(dashboard)/chatroom"
    click FloorPlan "https://github.com/RS-labhub/festigo/tree/main/app/(dashboard)/floor-planning"
    click GuestMgmt "https://github.com/RS-labhub/festigo/tree/main/app/(dashboard)/guests"
    click VendorMgmt "https://github.com/RS-labhub/festigo/tree/main/app/(dashboard)/vendors"
    click PaymentSys "https://github.com/RS-labhub/festigo/tree/main/app/(dashboard)/payouts"
    click Button "https://github.com/RS-labhub/festigo/blob/main/components/common/Button.tsx"
    click Modal "https://github.com/RS-labhub/festigo/blob/main/components/common/Modal.tsx"
    click Input "https://github.com/RS-labhub/festigo/blob/main/components/common/InputField.tsx"
    click EventForm "https://github.com/RS-labhub/festigo/blob/main/components/common/EventForm.tsx"
    click AuthAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/auth"
    click EventAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/event"
    click ChatAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/chats"
    click ChannelAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/channels"
    click GuestAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/guest"
    click VendorAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/vendors"
    click PaymentAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/payments"
    click VenueAPI "https://github.com/RS-labhub/festigo/tree/main/app/api/venue"
    click PrismaORM "https://github.com/RS-labhub/festigo/blob/main/prisma/schema.prisma"
    click DBConn "https://github.com/RS-labhub/festigo/blob/main/app/db/index.ts"
    click EmailService "https://github.com/RS-labhub/festigo/blob/main/Utils/sendMail.ts"
    
    %% Styling
    classDef auth fill:#e1bee7
    classDef dashboard fill:#bbdefb
    classDef common fill:#c8e6c9
    classDef home fill:#fff9c4
    classDef api fill:#ffccbc
    classDef db fill:#d1c4e9
    classDef model fill:#b2dfdb
    classDef external fill:#f8bbd0
```
