# afonsodasilva1/resolucao-teste-tecnico-desenvolvimento-fronteend architecture

> Architecture diagram of the GitHub repository afonsodasilva1/resolucao-teste-tecnico-desenvolvimento-fronteend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/afonsodasilva1/resolucao-teste-tecnico-desenvolvimento-fronteend
- Repository: https://github.com/afonsodasilva1/resolucao-teste-tecnico-desenvolvimento-fronteend

## Overview

##### Main System Components

a) Client-Side Layer:
- Next.js Application (Core)
- Pages/Routes Structure
- Component Library
- State Management (TanStack Query)

b) API Layer:
- JSON Server (Mock API)
- API Integration Layer

##### Detailed Component Breakdown

A. Application Core:
- Providers section (QueryClientProvider)
- Global configuration (mantineTheme, tailwind config)

B. Page Structure:
- Dashboard
- New Doctor
- Users

C. Component Architecture:
- Shared Components (Form, Header, InputGroup)
- Page-Specific Components
- Component relationships and reusability

D. Data Flow:
- Data flow between:
- Components and API
- TanStack Query interactions
- State management flow

##### Specific Implementation Details

Technical aspects:

**[Next.js App Container]**
- [Providers]
- QueryClientProvider
- [Pages]
- Dashboard
- New Doctor
- List Users
- [Shared Components]
- Form Components
- Header
- Input Groups
- [API Integration]
- JSON Server Connection

##### Additional Elements

Supporting details:

- Notes about the mock API integration
- Component communication patterns
- Error handling flow
- State management strategy

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Next.js Application"
        Core["Next.js Core"]:::core
        click Core "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/layout.tsx"
        
        subgraph "Global Configuration"
            MantineTheme["Mantine Theme"]:::config
            TailwindConfig["Tailwind Config"]:::config
            NextConfig["Next Config"]:::config
            click MantineTheme "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/mantineTheme.tsx"
            click TailwindConfig "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/tailwind.config.ts"
            click NextConfig "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/next.config.mjs"
        end

        subgraph "Providers"
            QueryProvider["Query Client Provider"]:::provider
            click QueryProvider "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/Providers/QueryClientProvider.tsx"
        end

        subgraph "Pages"
            Dashboard["Dashboard"]:::page
            NewDoctor["New Doctor"]:::page
            ListUsers["List Users"]:::page
            click Dashboard "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/(pages)/dashboard/page.tsx"
            click NewDoctor "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/(pages)/new_doctor/page.tsx"
            click ListUsers "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/(pages)/dashboard/ListUsers/index.tsx"
        end

        subgraph "Shared Components"
            Form["Form Components"]:::component
            Header["Header"]:::component
            InputGroup["Input Group"]:::component
            NextLink["Next Link"]:::component
            click Form "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/components/Form"
            click Header "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/components/Header"
            click InputGroup "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/components/InputGroup"
            click NextLink "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/components/NextLink"
        end

        subgraph "Page Components"
            NewDoctorForm["New Doctor Form"]:::pageComponent
            ListHeader["List Header"]:::pageComponent
            ListUserItem["List User Item"]:::pageComponent
            click NewDoctorForm "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/(pages)/new_doctor/NewDoctorForm"
            click ListHeader "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/(pages)/dashboard/ListUsers/ListHeader"
            click ListUserItem "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/(pages)/dashboard/ListUsers/LIstUserItem"
        end

        subgraph "Types and Utils"
            Types["Type Definitions"]:::utils
            Constants["Constants"]:::utils
            TwMerge["TW Merge"]:::utils
            click Types "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/@types/Types.ts"
            click Constants "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/tree/main/src/app/constants"
            click TwMerge "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/utils/twMerge.tsx"
        end
    end

    subgraph "API Layer"
        APIIntegration["API Integration"]:::api
        JSONServer["JSON Server"]:::api
        click APIIntegration "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/src/app/api/index.ts"
        click JSONServer "https://github.com/afonsodasilva1/Resolucao-Teste-Tecnico-Desenvolvimento-FronteEnd/blob/main/server.json"
    end

    %% Relationships
    Core --> QueryProvider
    Core --> MantineTheme
    Core --> TailwindConfig
    Core --> NextConfig
    
    QueryProvider --> Dashboard
    QueryProvider --> NewDoctor
    QueryProvider --> ListUsers
    
    Dashboard --> ListHeader
    Dashboard --> ListUserItem
    NewDoctor --> NewDoctorForm
    
    NewDoctorForm --> Form
    NewDoctorForm --> InputGroup
    ListHeader --> Header
    
    APIIntegration --> JSONServer
    QueryProvider --> APIIntegration
    
    %% Styles
    classDef core fill:#2b6cb0,stroke:#1a4971,color:white
    classDef config fill:#ecc94b,stroke:#d69e2e,color:black
    classDef provider fill:#48bb78,stroke:#2f855a,color:white
    classDef page fill:#4299e1,stroke:#3182ce,color:white
    classDef component fill:#38b2ac,stroke:#319795,color:white
    classDef pageComponent fill:#4fd1c5,stroke:#38b2ac,color:white
    classDef utils fill:#9f7aea,stroke:#805ad5,color:white
    classDef api fill:#f56565,stroke:#e53e3e,color:white
```
