# siddythings/isvalid architecture

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

## Overview

##### Main System Components

a) Frontend Layer (Next.js Application):
- Auth Module (/(auth) directory)
- Dashboard Module (/dashboard)
- Product Management
- Kanban Board
- Profile Management
- QR Code Generation & Verification

b) API Layer:
- Create two API sections:
- Next.js API Routes (/app/api)
- Python FastAPI Backend (/api)

c) Database Layer:
- MongoDB (indicated by /api/settings/mongo.py)

##### Component Relationships

a) Client-Side Flow:
- User Interface → Next.js API Routes → Python Backend
- Authentication flow through NextAuth
- File upload flow to S3 (indicated by s3_resources.py)

b) Server-Side Flow:
- API Routes → Database interactions
- Authentication middleware connections
- Payment gateway integration (shown by payment_gateway.py)

##### Specific Implementation Details

Specialized sections for:

a) Authentication System:
- GitHub authentication
- NextAuth implementation
- Custom user authentication forms

b) Feature Modules:
- Product Management System
- Employee Management
- Kanban Board
- QR Code Generation & Verification
- Analytics Dashboard

##### External Services Integration

Connections to:
- AWS S3 for file storage
- Payment Gateway
- Email Service (indicated by email_template.py)

##### Technical Stack Indicators

- Next.js 13+ (App Router)
- FastAPI (Python)
- MongoDB
- TypeScript
- TailwindCSS
- Shadcn UI Components

##### Data Flow Patterns

Highlight:
- RESTful API routes
- Authentication flows
- File upload processes
- QR code generation and verification paths

- How the frontend interacts with both API layers
- The authentication flow across the stack
- How product and QR code management is implemented
- Where and how external services are integrated
- The data flow patterns throughout the application

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI[Client Interface]
        Auth["Authentication Module"]
        Dashboard["Dashboard Module"]
        Products["Product Management"]
        Kanban["Kanban Board"]
        Profile["Profile Management"]
        QR["QR Code Generation & Verification"]
        Analytics["Analytics Dashboard"]
        Employee["Employee Management"]
    end

    subgraph "API Layer"
        NextAPI["Next.js API Routes"]
        FastAPI["Python FastAPI Backend"]
    end

    subgraph "Database Layer"
        MongoDB[(MongoDB)]
    end

    subgraph "External Services"
        S3["AWS S3"]
        Payment["Payment Gateway"]
        Email["Email Service"]
        GitHub["GitHub Auth"]
    end

    UI --> Auth
    UI --> Dashboard
    UI --> Products
    UI --> Kanban
    UI --> Profile
    UI --> QR
    UI --> Analytics
    UI --> Employee

    Auth --> NextAPI
    Dashboard --> NextAPI
    Products --> NextAPI
    Kanban --> NextAPI
    Profile --> NextAPI
    QR --> NextAPI
    Analytics --> NextAPI
    Employee --> NextAPI

    NextAPI --> FastAPI
    FastAPI --> MongoDB
    FastAPI --> S3
    FastAPI --> Payment
    FastAPI --> Email
    Auth -.-> GitHub

    classDef frontend fill:#3b82f6,color:#fff
    classDef api fill:#22c55e,color:#fff
    classDef database fill:#eab308,color:#fff
    classDef external fill:#ef4444,color:#fff

    class UI,Auth,Dashboard,Products,Kanban,Profile,QR,Analytics,Employee frontend
    class NextAPI,FastAPI api
    class MongoDB database
    class S3,Payment,Email,GitHub external

    click Auth "https://github.com/siddythings/isvalid/tree/main/app/(auth)"
    click Dashboard "https://github.com/siddythings/isvalid/tree/main/app/dashboard"
    click Products "https://github.com/siddythings/isvalid/tree/main/app/dashboard/product"
    click Kanban "https://github.com/siddythings/isvalid/tree/main/app/dashboard/kanban"
    click Profile "https://github.com/siddythings/isvalid/tree/main/app/dashboard/profile"
    click QR "https://github.com/siddythings/isvalid/tree/main/app/verify"
    click NextAPI "https://github.com/siddythings/isvalid/tree/main/app/api"
    click FastAPI "https://github.com/siddythings/isvalid/tree/main/api/"
    click MongoDB "https://github.com/siddythings/isvalid/blob/main/api/settings/mongo.py"
    click S3 "https://github.com/siddythings/isvalid/blob/main/api/resources/s3_resources.py"
    click Payment "https://github.com/siddythings/isvalid/blob/main/api/common/payment_gateway.py"
    click Email "https://github.com/siddythings/isvalid/blob/main/api/common/email_template.py"
    click Analytics "https://github.com/siddythings/isvalid/tree/main/app/dashboard/overview"
    click Employee "https://github.com/siddythings/isvalid/tree/main/app/dashboard/employee"
```
