# chien100503/graduation_project architecture

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

- Interactive diagram: https://gitdiagram.com/chien100503/graduation_project
- Repository: https://github.com/chien100503/graduation_project

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with Create React App, packaged in a Docker container, and served via Nginx.
- Its primary purpose is to provide a password-reset workflow, displaying success or failure animations to the user.

##### File structure
- Top-level files:
- Dockerfile, docker-compose.yml, nginx.conf → containerization and deployment
- package.json / package-lock.json → React dependencies and scripts
- README.md → CRA boilerplate instructions
- public/ → static assets (index.html, manifest, robots.txt)
- src/
- App.js, index.js, reportWebVitals.js, setupTests.js → entry points and instrumentation
- ResetPasswordForm.js, Success.js, Failure.js → core UI screens
- src/animations → Lottie JSONs for success/failure
- src/config/config.jsx → environment settings (API endpoints, feature flags)
- src/styles → component-scoped CSS modules + global styles

##### README insights
- No bespoke architecture notes—just standard CRA usage and available npm scripts.
- We infer deployment is via Docker + Nginx.

##### Detail
- Every folder/component: public vs. src, config, animations, styles.
- Environment‐specific config injection from src/config.

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Development Environment"
    Dev["Developer Workstation"]:::dev
    Git["Git Repository"]:::dev
    Dev -->|"push code"| Git
  end

  subgraph "CI/CD Pipeline"
    CI["CI/CD System"]:::build
    Git --> CI
    CI -->|"npm run build"| Build["Build Artifacts (/build)"]:::build
  end

  subgraph "Containerization"
    Build --> DockerBuild["Docker Build (Dockerfile)"]:::build
    click DockerBuild "https://github.com/chien100503/graduation_project/tree/web-forget-pass/./Dockerfile"
    DockerBuild --> Image["Docker Image"]:::build
  end

  subgraph "Deployment"
    Image --> Compose["Docker Compose"]:::build
    click Compose "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./docker-compose.yml"
    Compose --> Nginx["Nginx Container"]:::runtime
    click Nginx "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./nginx.conf"
    Nginx -->|"serve index.html, bundle"| Public["Public Assets & Bundle"]:::runtime
    click Public "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./public/index.html"
    click Public "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./public/manifest.json"
    click Public "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./public/robots.txt"
  end

  subgraph "Browser & SPA Runtime"
    Browser["Browser"]:::runtime
    Browser -->|"HTTP GET /"| Nginx
    Browser --> ReactApp["React SPA"]:::runtime

    ReactApp -->|"bootstrap"| IndexJS["src/index.js"]:::runtime
    click IndexJS "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/index.js"
    ReactApp --> AppJS["src/App.js"]:::runtime
    click AppJS "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/App.js"
    ReactApp --> ReportWV["src/reportWebVitals.js"]:::runtime
    click ReportWV "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/reportWebVitals.js"
    ReactApp --> SetupTests["src/setupTests.js"]:::runtime
    click SetupTests "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/setupTests.js"

    ReactApp --> Config["src/config/config.jsx"]:::runtime
    click Config "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/config/config.jsx"
    ReactApp -->|"load animations"| Animations["Lottie JSONs"]:::runtime
    click Animations "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/animations/success-check.json"
    click Animations "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/animations/failure-cross.json"
    ReactApp -->|"apply styles"| Styles["CSS Modules & Global CSS"]:::runtime
    click Styles "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/styles/ResetPasswordForm.module.css"
    click Styles "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/styles/Success.module.css"
    click Styles "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/styles/Failure.module.css"
    click Styles "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/styles/index.css"

    ReactApp -->|"XHR POST /reset-password"| API["External Auth Service"]:::external
    API -->|"200/400 response"| ReactApp

    ReactApp --> UI["ResetPasswordForm / Success / Failure Screens"]:::runtime
    click UI "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/ResetPasswordForm.js"
    click UI "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/Success.js"
    click UI "https://github.com/chien100503/graduation_project/blob/web-forget-pass/./src/Failure.js"
  end

  classDef dev fill:#ddeeff,stroke:#3399ff,color:#000;
  classDef build fill:#cce5ff,stroke:#005cbf,color:#000;
  classDef runtime fill:#d4edda,stroke:#155724,color:#000;
  classDef external fill:#ffe5cc,stroke:#e66a00,color:#000
```
