# vindiarputra/student_attendance_crud architecture

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

## Overview

##### Main Components

A. Client Layer:
- React Frontend (Vite + TypeScript)
- Key UI Components (ShadcnUI)
- TailwindCSS Styling

B. Server Layer:
- PHP Native Backend
- REST API Endpoints

C. Data Layer:
- MySQL Database
- 'attendance' table

**┌─────────────────────────────────────┐**
- Frontend (React + TypeScript)       │
- UI Components                     │
- State Management                  │
- API Integration                   │
- ┘
- ↕ HTTP/REST
**┌─────────────────────────────────────┐**
- Backend (PHP Native)                │
- API Endpoints                     │
- Business Logic                    │
- File Handling (proof_image)       │
- ┘
- ↕ SQL Queries
**┌─────────────────────────────────────┐**
- Database (MySQL)                    │
- attendance table                  │
- Data Storage                      │
- ┘

##### Component Details

Frontend Section:
- Sub-components:
- UI Components (buttons, calendar, tables, etc.)
- TypeScript types/interfaces
- API integration layer
- Routing logic

Backend Section:
- Components for:
- API endpoints
- Database connection (koneksi.php)
- File handling for proof images
- Business logic layer

Database Section:
- 'attendance' table structure:
- id (Primary Key)
- student_name
- status (enum)
- date
- proof_image

- User interactions → Frontend
- Frontend → Backend API calls
- Backend → Database queries
- Response paths back to the user

##### Additional Elements

Technical details:
- Port numbers (5173 for frontend)
- Technology versions
- Authentication flow (if implemented)
- File storage system for proof images

##### Notes
- Deployment environment (XAMPP)
- Database connection configuration
- Optional components (like dummy data)

Remember to:
- Critical paths
- Error handling flows
- Document external dependencies

This system design should provide a clear understanding of how the School Attendance Management System works, from user interaction through to data storage, while maintaining the appropriate level of detail for a principal software engineer to understand the complete architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        FE[React Frontend]
        UI[UI Components]
        STATE[State Management]
        API_INT[API Integration]
        
        FE --> UI
        FE --> STATE
        FE --> API_INT
    end

    subgraph Server
        BE[PHP Backend]
        API[API Endpoints]
        BL[Business Logic]
        FH[File Handling]
        
        BE --> API
        BE --> BL
        BE --> FH
    end

    subgraph Database
        DB[(MySQL Database)]
        AT[("attendance table")]
        
        DB --> AT
    end

    API_INT --> API
    API --> DB
    FH --> DB

    %% Component Mappings
    click FE "https://github.com/vindiarputra/Student_Attendance_CRUD/blob/main/frontend/src/App.tsx"
    click UI "https://github.com/vindiarputra/Student_Attendance_CRUD/tree/main/frontend/src/components/ui/"
    click API_INT "https://github.com/vindiarputra/Student_Attendance_CRUD/blob/main/frontend/src/lib/utils.ts"
    click FE "https://github.com/vindiarputra/Student_Attendance_CRUD/blob/main/frontend/src/main.tsx"
    click FE "https://github.com/vindiarputra/Student_Attendance_CRUD/blob/main/frontend/tailwind.config.js"
    click FE "https://github.com/vindiarputra/Student_Attendance_CRUD/blob/main/frontend/vite.config.ts"
    click BE "https://github.com/vindiarputra/Student_Attendance_CRUD/blob/main/backend/koneksi.php"
    click FH "https://github.com/vindiarputra/Student_Attendance_CRUD/tree/main/backend/proof/"

    %% Styling
    classDef frontend fill:#3b82f6,color:white
    classDef backend fill:#22c55e,color:white
    classDef database fill:#f97316,color:white
    classDef dataflow fill:#6b7280,color:white

    class FE,UI,STATE,API_INT frontend
    class BE,API,BL,FH backend
    class DB,AT database
    
    %% Legend
    subgraph Legend
        L1[Frontend Component]:::frontend
        L2[Backend Component]:::backend
        L3[(Database Component)]:::database
    end
```
