# hoangminhfcb/idcard architecture

> Architecture diagram of the GitHub repository hoangminhfcb/idcard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hoangminhfcb/idcard
- Repository: https://github.com/hoangminhfcb/idcard

## Overview

##### Project Type & Purpose
- This is a front-end project meant to display an electronic business card.
- The README indicates that the project has evolved through multiple versions and focuses on mobile usability, with functionalities such as photo enlarging and toast messages replacing alerts. It also mentions NFC sharing in earlier versions.
- There is no separate backend layer: all the logic and presentation are handled in the client’s browser.

##### File Structure
- At the top level, you have configuration files (.gitignore, Dockerfile, README.md) and key entry files (index.html, serviceWorker.js).
- The assets directory is broken down into subdirectories:
- CSS: Contains styles (notification.css, style.css) that control the presentation.
- JS: Contains the JavaScript modules (Notification.js, app.js, effect.js, symbol.js) which handle user interactions, notifications, effects, and possibly symbolic functions.
- IMG: Holds the images used in the site.
- VCF: Contains a vCard file (vcf.vcf) for sharing contact information.
- The Dockerfile suggests that there’s potential containerization for deployment, though the project itself is static.

##### Key Components & Relationships to Capture
- “Frontend/Mobile Browser” (Client):
- Represents the user’s device accessing the site.
- “index.html” (Main Entry & Layout File):
- This file serves as the entry point for the web application and ties all assets together.
- “assets” Folder:
- “css” Subfolder: Provides styling (e.g., using style.css for overall layout and notification.css for toast messages).
- “js” Subfolder: Provides the interactive functionalities and effects (Notification.js for toast messages, app.js for core functionality, effect.js for interactive effects, and symbol.js for any symbolic/graphical utilities).
- “img” Subfolder: Contains images relevant to the business card.
- “vcf” Subfolder: Holds the contact file for NFC or sharing purposes.
- “serviceWorker.js”:
- Illustrates Progressive Web App (PWA) behavior such as caching and offline support.
- “Dockerfile”:
- Indicates how the application can be containerized, though it primarily targets a static deployment environment.
- Optional External Components:
- Hosting environment such as GitHub Pages and the mobile demo mode referenced in the README.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Docker["Docker Environment"]:::deployment
    Client["Browser/Mobile Client"]:::client
    HTML["index.html - Main Entry"]:::html
    CSS["CSS Assets"]:::asset
    JS["JavaScript Assets"]:::asset
    Img["Image Assets"]:::asset
    vCard["vCard Asset"]:::asset
    Worker["Service Worker"]:::worker

    Docker -->|"deploys"| HTML
    Client -->|"loads"| HTML
    HTML -->|"styles"| CSS
    HTML -->|"scripts"| JS
    HTML -->|"shows"| Img
    HTML -->|"shares"| vCard
    HTML -->|"registers"| Worker

    click Client "https://github.com/hoangminhfcb/idcard/blob/main/index.html"
    click HTML "https://github.com/hoangminhfcb/idcard/blob/main/index.html"
    click CSS "https://github.com/hoangminhfcb/idcard/tree/main/assets/css"
    click JS "https://github.com/hoangminhfcb/idcard/tree/main/assets/js"
    click Img "https://github.com/hoangminhfcb/idcard/tree/main/assets/img"
    click vCard "https://github.com/hoangminhfcb/idcard/blob/main/assets/vcf/vcf.vcf"
    click Worker "https://github.com/hoangminhfcb/idcard/blob/main/serviceWorker.js"
    click Docker "https://github.com/hoangminhfcb/idcard/tree/main/Dockerfile"

    classDef client fill:#FFDB58,stroke:#333,stroke-width:2px;
    classDef html fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef asset fill:#98FB98,stroke:#333,stroke-width:2px;
    classDef worker fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef deployment fill:#DDA0DD,stroke:#333,stroke-width:2px;
```
