# dagmawi-y/ideaspring-v2 architecture

> Architecture diagram of the GitHub repository dagmawi-y/ideaspring-v2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dagmawi-y/ideaspring-v2
- Repository: https://github.com/dagmawi-y/ideaspring-v2

## Overview

##### Main Components Identification

The system appears to have these primary components:

a) Frontend Layer (SvelteKit Application)
- Authentication Module (/auth routes)
- User Type-Specific Modules:
- Entrepreneur Dashboard
- Investor Dashboard
- Engager Interface
- Messaging System
- Explore/Discovery Feature
- Profile Management

b) Backend Services (Firebase)
- Authentication Service
- Database Service
- Storage Service (for documents/images)

**Client Layer (Browser)**
**↓**
**Frontend Application (SvelteKit)**
**↓**
**Backend Services (Firebase)**
**↓**
**Data Storage**

**Authentication → User Management → Feature Modules → Communication**

##### Specific Components

Frontend (SvelteKit):
- Shared components (NavBar, Footer, Cards)
- Stores (userStore, addStartupFormData, activeTab)

Backend (Firebase):
- Authentication Service
- Realtime Database/Firestore
- Storage Bucket
- Security Rules

##### Connection Flows

Key interactions:
- User authentication flow
- Data fetching/updating paths
- Real-time communication channels
- File upload/download paths

##### Architectural Patterns to Highlight

- SvelteKit's file-based routing
- Component-based architecture
- Store-based state management
- Service-based communication

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph Frontend["Frontend Layer"]
        Router["SvelteKit Router"]
        
        subgraph Auth["Authentication Module"]
            AuthRoutes["/auth Routes"]:::frontend
            AuthComponents["Auth Components"]:::frontend
        end

        subgraph UserDashboards["User Dashboards"]
            EntrepreneurDash["Entrepreneur Dashboard"]:::frontend
            InvestorDash["Investor Dashboard"]:::frontend
            EngagerInterface["Engager Interface"]:::frontend
        end

        subgraph Features["Core Features"]
            Messaging["Messaging System"]:::frontend
            Explore["Explore/Discovery"]:::frontend
            Profile["Profile Management"]:::frontend
            StartupMgmt["Startup Management"]:::frontend
        end

        subgraph SharedComponents["Shared Components"]
            NavBar["Navigation Bar"]:::frontend
            Footer["Footer"]:::frontend
            Cards["Card Components"]:::frontend
            AnimatedRoute["Route Animation"]:::frontend
        end

        subgraph StateManagement["State Management"]
            UserStore["User Store"]:::store
            StartupFormStore["Startup Form Store"]:::store
            TabStore["Active Tab Store"]:::store
        end

        API["API Integration"]:::frontend
    end

    subgraph Backend["Firebase Backend"]
        Auth_Service["Authentication Service"]:::backend
        Database["Realtime Database"]:::database
        Storage["Storage Bucket"]:::storage
        SecurityRules["Security Rules"]:::security
    end

    %% Connections
    Browser --> Router
    Router --> Auth
    Router --> UserDashboards
    Router --> Features
    
    Auth --> Auth_Service
    UserDashboards --> API
    Features --> API
    API --> Database
    API --> Storage

    %% Click Events
    click AuthRoutes "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/auth"
    click EntrepreneurDash "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/entrepreneur"
    click InvestorDash "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/investor"
    click EngagerInterface "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/engager"
    click Messaging "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/message"
    click Explore "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/explore"
    click Profile "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/entrepreneur/accountSettings"
    click NavBar "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/components/navBar/NavBar.svelte"
    click Footer "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/components/footer/Footer.svelte"
    click UserStore "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/stores/userStore.ts"
    click StartupFormStore "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/stores/addStartupFormData.ts"
    click TabStore "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/stores/activeTab.ts"
    click StartupMgmt "https://github.com/Dagmawi-Y/ideaspring-v2/tree/main/src/routes/entrepreneur/addPitch"
    click Cards "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/components/startupCard/StartupCard.svelte"
    click AnimatedRoute "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/components/animatedRoute/AnimatedRoute.svelte"
    click API "https://github.com/Dagmawi-Y/ideaspring-v2/blob/main/src/lib/api.ts"

    %% Styles
    classDef frontend fill:#3498db,color:#fff
    classDef backend fill:#2ecc71,color:#fff
    classDef database fill:#9b59b6,color:#fff
    classDef storage fill:#e67e22,color:#fff
    classDef security fill:#e74c3c,color:#fff
    classDef store fill:#f1c40f,color:#fff

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Service"]:::backend
        DB["Database"]:::database
        Store["State Store"]:::store
        Secure["Security"]:::security
    end
```
