# nst-sdc/devcoin architecture

> Architecture diagram of the GitHub repository nst-sdc/devcoin, 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/nst-sdc/devcoin
- Repository: https://github.com/nst-sdc/devcoin

## Overview

##### Main Components

A. Frontend Layer:
- React Application (TypeScript-based)
- Components Structure
- Auth Components
- Member Management
- Project Management
- Admin Panel
- Context Providers (AuthContext)

B. Services Layer:
- Firebase Integration
- GitHub Integration
- Local Storage Service
- Authentication Service
- Admin Service
- Projects Service
- Contributions Service

C. Data Layer:
- DataConnect Integration
- GraphQL Schema
- Queries and Mutations
- Connector Configuration

D. External Services:
- Firebase Authentication
- GitHub API
- Vercel Deployment

**[Client Layer]**
- ↑↓
**[Services Layer]**
- ↑↓
**[Data Layer]**

##### Specific Implementation Details

a) Client Layer (Top):
- Create sub-containers for:
- Pages (HomePage, CoinsPage, LeaderboardPage, etc.)
- Components (Auth, Member Management, Projects)
- Context Providers

b) Services Layer (Middle):
- Firebase Service (Authentication & Database)
- GitHub Integration Service
- Local Storage Service
- Business Logic Services

c) Data Layer (Bottom):
- DataConnect infrastructure
- GraphQL schema and connections
- Database storage

##### Technical Stack Indicators

A tech stack sidebar showing:
- React + TypeScript
- Tailwind CSS
- Firebase
- GraphQL
- Vite
- DataConnect

##### Deployment Flow

A separate section showing:
- Vercel deployment pipeline
- Environment configurations
- Build process

Key Relationships to Emphasize:
##### Project Management Pipeline

Remember to include:
- Clear component boundaries
- Data flow directions
- Security checkpoints
- External service integrations
- Caching mechanisms
- State management flow

This system design should effectively communicate how the Dev Club Portal manages user authentication, tracks contributions, handles DevCoins, and maintains the leaderboard system while ensuring secure admin access and efficient project management.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Frontend Layer"
        UI_COMP["React Components"]
        PAGES["Application Pages"]
        CONTEXT["Context Management"]
        AUTH_COMP["Auth Components"]
        PROFILE["User Profile"]
        MEMBER["Member Management"]
        ADMIN["Admin Panel"]
        PROJECT_COMP["Project Components"]
    end

    subgraph "Auth & Context Layer"
        AUTH_CTX["Auth Context"]
        FIREBASE_AUTH["Firebase Auth"]
    end

    subgraph "Services Layer"
        GITHUB_SVC["GitHub Service"]
        LOCAL_STORE["Local Storage"]
        CONTRIB_SVC["Contribution Service"]
        PROJECT_SVC["Project Service"]
        DATA_CONNECT["DataConnect System"]
    end

    subgraph "External Services"
        FIREBASE["Firebase"]
        GITHUB_API["GitHub API"]
        GRAPHQL["GraphQL Layer"]
    end

    UI_COMP --> CONTEXT
    PAGES --> UI_COMP
    AUTH_COMP --> UI_COMP
    PROFILE --> UI_COMP
    MEMBER --> UI_COMP
    ADMIN --> UI_COMP
    PROJECT_COMP --> UI_COMP

    AUTH_CTX --> FIREBASE_AUTH
    AUTH_COMP --> AUTH_CTX
    FIREBASE_AUTH --> FIREBASE

    UI_COMP --> GITHUB_SVC
    UI_COMP --> LOCAL_STORE
    UI_COMP --> CONTRIB_SVC
    UI_COMP --> PROJECT_SVC
    UI_COMP --> DATA_CONNECT

    GITHUB_SVC --> GITHUB_API
    DATA_CONNECT --> GRAPHQL

    click UI_COMP "https://github.com/nst-sdc/DevCoin/tree/main/src/components/"
    click PAGES "https://github.com/nst-sdc/DevCoin/tree/main/src/pages/"
    click CONTEXT "https://github.com/nst-sdc/DevCoin/tree/main/src/contexts/"
    click AUTH_COMP "https://github.com/nst-sdc/DevCoin/tree/main/src/components/auth/"
    click PROFILE "https://github.com/nst-sdc/DevCoin/blob/main/src/components/EditProfileModal.tsx"
    click MEMBER "https://github.com/nst-sdc/DevCoin/blob/main/src/components/MemberCard.tsx"
    click ADMIN "https://github.com/nst-sdc/DevCoin/blob/main/src/components/admin/AdminPanel.tsx"
    click PROJECT_COMP "https://github.com/nst-sdc/DevCoin/blob/main/src/components/projects/ProjectCard.tsx"
    click AUTH_CTX "https://github.com/nst-sdc/DevCoin/blob/main/src/contexts/AuthContext.tsx"
    click FIREBASE_AUTH "https://github.com/nst-sdc/DevCoin/blob/main/src/services/firebase.ts"
    click GITHUB_SVC "https://github.com/nst-sdc/DevCoin/blob/main/src/services/github.ts"
    click LOCAL_STORE "https://github.com/nst-sdc/DevCoin/blob/main/src/services/localStore.ts"
    click CONTRIB_SVC "https://github.com/nst-sdc/DevCoin/blob/main/src/services/contributions.ts"
    click PROJECT_SVC "https://github.com/nst-sdc/DevCoin/blob/main/src/services/projects.ts"
    click DATA_CONNECT "https://github.com/nst-sdc/DevCoin/tree/main/dataconnect/"
    click GRAPHQL "https://github.com/nst-sdc/DevCoin/blob/main/dataconnect/schema/schema.gql"

    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef auth fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white
    classDef admin fill:#e74c3c,stroke:#c0392b,color:white

    class UI_COMP,PAGES,CONTEXT,PROFILE,MEMBER,PROJECT_COMP frontend
    class AUTH_COMP,AUTH_CTX,FIREBASE_AUTH auth
    class GITHUB_SVC,LOCAL_STORE,CONTRIB_SVC,PROJECT_SVC,DATA_CONNECT service
    class FIREBASE,GITHUB_API,GRAPHQL external
    class ADMIN admin
```
