# with-alif/alif_protfolio architecture

> Architecture diagram of the GitHub repository with-alif/alif_protfolio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/with-alif/alif_protfolio
- Repository: https://github.com/with-alif/alif_protfolio

## Overview

#### Purpose and Entry Points
This is a framework-free personal portfolio with a Supabase-backed CMS. The public site starts at `index.html`, with JavaScript bootstrapping from `script/main.js`; the management interface is split between `admin/index.html` (login) and `admin/panel.html` (content dashboard). A Vercel serverless endpoint at `api/telegram.js` handles Telegram notifications.

#### Public Application Composition
The public page is assembled as modular DOM-rendered sections coordinated by `script/body.js` and `core/app.js`. Section builders represent the major portfolio domains—profile, experience, projects, skills, services, contact, and related content—under `script/sections/`. Global and component CSS is distributed across `lib/`, `app/`, and `style/`, keeping the runtime static and browser-native.

#### Data Access and Content Rendering
Supabase is the central content boundary. `config/supabase.js` initializes database access, while `config/schema.sql` defines the database schema and row-level-security model. Public renderers load remote content through `script/utils/loadData.js`, then convert it into section-specific UI; project-specific rendering and detail presentation reside in `project/projects.js` and `project/project-details.js`.

#### CMS Administration
The admin flow authenticates users through `admin/admin.js`, then exposes Supabase CRUD operations through `admin/panel.js`. The dashboard manages the same content entities consumed by the public portfolio, allowing updates to propagate through the shared database rather than source edits. Admin views are isolated from the public site at `admin/index.html` and `admin/panel.html`.

#### Contact and Notification Pipeline
Contact submissions are handled client-side by `config/mailer.js`, using EmailJS configuration in `config/config.js` for inbox delivery. The notification path also reaches the deployed Vercel endpoint `api/telegram.js`, which uses server-side environment variables to call the Telegram Bot API. This separates sensitive Telegram credentials from static browser assets.

#### Interactive UI Subsystems
Projects support filtering, tags, rich details, and external links through `project/projects.js`, `project/project-details.js`, and `tags/tags.js`. Service content has its own dynamic interaction layer in `service/service.js`. SVG icon rendering is centralized in `icons/index.js`, with individual icon definitions such as `icons/github-icon.js`, avoiding a heavyweight icon runtime.

#### Runtime and Infrastructure Boundaries
The frontend is static HTML/CSS/ES modules and can run from a live server; Vercel is required when exercising serverless notification behavior. Supabase provides PostgreSQL persistence and authentication/RLS-backed access control; EmailJS and Telegram are external messaging services. Configuration and schema ownership are concentrated in `config/`, while `api/telegram.js` is the only server-side execution boundary visible in this tree.

Main entry points: [`core/app.js`](https://github.com/with-alif/alif_protfolio/blob/main/core/app.js) (Application core), [`config/mailer.js`](https://github.com/with-alif/alif_protfolio/blob/main/config/mailer.js) (Contact handler), [`config/supabase.js`](https://github.com/with-alif/alif_protfolio/blob/main/config/supabase.js) (Supabase client), [`project/projects.js`](https://github.com/with-alif/alif_protfolio/blob/main/project/projects.js) (Projects UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public portfolio"]
  node_public_entry["Public entry<br/>HTML entry<br/>[index.html]"]
  node_public_bootstrap["Browser bootstrap<br/>ES module<br/>[main.js]"]
  node_page_composer["Page composition<br/>DOM renderer<br/>[body.js]"]
  node_app_core["Application core<br/>UI coordinator<br/>[app.js]"]
  node_portfolio_sections["Portfolio sections<br/>section builders"]
  node_data_loader["Content loader<br/>data access<br/>[loadData.js]"]
  node_projects_ui["Projects UI<br/>interactive renderer<br/>[projects.js]"]
  node_tags_ui["Tag interactions<br/>UI subsystem<br/>[tags.js]"]
  node_services_ui["Service interactions<br/>UI subsystem<br/>[service.js]"]
end

subgraph group_admin["CMS administration"]
  node_admin_login["Admin login<br/>HTML entry<br/>[index.html]"]
  node_admin_auth["Admin authentication<br/>auth client<br/>[admin.js]"]
  node_admin_panel["Content dashboard<br/>CMS CRUD client<br/>[panel.js]"]
end

subgraph group_data["Content and configuration"]
  node_supabase_client["Supabase client<br/>database client<br/>[supabase.js]"]
  node_supabase[("Supabase<br/>PostgreSQL, Auth, RLS<br/>[schema.sql]")]
end

subgraph group_notifications["Contact notifications"]
  node_contact_mailer["Contact handler<br/>browser mail client<br/>[mailer.js]"]
  node_emailjs_config["EmailJS config<br/>client configuration<br/>[config.js]"]
  node_emailjs["EmailJS<br/>external email service"]
  node_telegram_api{{"Telegram endpoint<br/>Vercel serverless function<br/>[telegram.js]"}}
  node_telegram["Telegram Bot API<br/>external messaging API"]
end

node_public_entry -->|"loads"| node_public_bootstrap
node_public_bootstrap -->|"starts"| node_page_composer
node_page_composer -->|"coordinates"| node_app_core
node_app_core -->|"renders"| node_portfolio_sections
node_app_core -->|"renders"| node_projects_ui
node_app_core -->|"renders"| node_services_ui
node_projects_ui -->|"uses"| node_tags_ui
node_portfolio_sections -->|"loads content"| node_data_loader
node_projects_ui -->|"loads projects"| node_data_loader
node_data_loader -->|"queries through"| node_supabase_client
node_supabase_client -->|"accesses"| node_supabase
node_admin_login -->|"loads"| node_admin_auth
node_admin_auth -->|"authenticates via"| node_supabase_client
node_admin_auth -->|"authorizes access"| node_admin_panel
node_admin_panel -->|"CRUD operations"| node_supabase_client
node_portfolio_sections -->|"submits contact"| node_contact_mailer
node_contact_mailer -->|"uses"| node_emailjs_config
node_contact_mailer -->|"delivers email"| node_emailjs
node_contact_mailer -->|"notifies"| node_telegram_api
node_telegram_api -->|"calls with server env"| node_telegram

click node_public_entry "https://github.com/with-alif/alif_protfolio/blob/main/index.html"
click node_public_bootstrap "https://github.com/with-alif/alif_protfolio/blob/main/script/main.js"
click node_page_composer "https://github.com/with-alif/alif_protfolio/blob/main/script/body.js"
click node_app_core "https://github.com/with-alif/alif_protfolio/blob/main/core/app.js"
click node_data_loader "https://github.com/with-alif/alif_protfolio/blob/main/script/utils/loadData.js"
click node_projects_ui "https://github.com/with-alif/alif_protfolio/blob/main/project/projects.js"
click node_tags_ui "https://github.com/with-alif/alif_protfolio/blob/main/tags/tags.js"
click node_services_ui "https://github.com/with-alif/alif_protfolio/blob/main/service/service.js"
click node_admin_login "https://github.com/with-alif/alif_protfolio/blob/main/admin/index.html"
click node_admin_auth "https://github.com/with-alif/alif_protfolio/blob/main/admin/admin.js"
click node_admin_panel "https://github.com/with-alif/alif_protfolio/blob/main/admin/panel.js"
click node_supabase_client "https://github.com/with-alif/alif_protfolio/blob/main/config/supabase.js"
click node_supabase "https://github.com/with-alif/alif_protfolio/blob/main/config/schema.sql"
click node_contact_mailer "https://github.com/with-alif/alif_protfolio/blob/main/config/mailer.js"
click node_emailjs_config "https://github.com/with-alif/alif_protfolio/blob/main/config/config.js"
click node_telegram_api "https://github.com/with-alif/alif_protfolio/blob/main/api/telegram.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_entry,node_public_bootstrap,node_page_composer,node_app_core,node_portfolio_sections,node_data_loader,node_projects_ui,node_tags_ui,node_services_ui toneBlue
class node_admin_login,node_admin_auth,node_admin_panel toneAmber
class node_supabase_client,node_supabase toneMint
class node_contact_mailer,node_emailjs_config,node_emailjs,node_telegram_api,node_telegram toneRose
```

## Components

### Public portfolio

- [Public entry](https://github.com/with-alif/alif_protfolio/blob/main/index.html): HTML entry · `index.html`
- [Browser bootstrap](https://github.com/with-alif/alif_protfolio/blob/main/script/main.js): ES module · `script/main.js`
- [Page composition](https://github.com/with-alif/alif_protfolio/blob/main/script/body.js): DOM renderer · Coordinates modular portfolio sections. · `script/body.js`
- [Application core](https://github.com/with-alif/alif_protfolio/blob/main/core/app.js): UI coordinator · `core/app.js`
- **Portfolio sections**: section builders · Profile, experience, skills, services, and contact UI.
- [Content loader](https://github.com/with-alif/alif_protfolio/blob/main/script/utils/loadData.js): data access · `script/utils/loadData.js`
- [Projects UI](https://github.com/with-alif/alif_protfolio/blob/main/project/projects.js): interactive renderer · Filtering, tags, project cards, and details. · `project/projects.js`
- [Tag interactions](https://github.com/with-alif/alif_protfolio/blob/main/tags/tags.js): UI subsystem · `tags/tags.js`
- [Service interactions](https://github.com/with-alif/alif_protfolio/blob/main/service/service.js): UI subsystem · `service/service.js`

### CMS administration

- [Admin login](https://github.com/with-alif/alif_protfolio/blob/main/admin/index.html): HTML entry · `admin/index.html`
- [Admin authentication](https://github.com/with-alif/alif_protfolio/blob/main/admin/admin.js): auth client · `admin/admin.js`
- [Content dashboard](https://github.com/with-alif/alif_protfolio/blob/main/admin/panel.js): CMS CRUD client · `admin/panel.js`

### Content and configuration

- [Supabase client](https://github.com/with-alif/alif_protfolio/blob/main/config/supabase.js): database client · `config/supabase.js`
- [Supabase](https://github.com/with-alif/alif_protfolio/blob/main/config/schema.sql): PostgreSQL, Auth, RLS · Shared persistence and access-control boundary. · `config/schema.sql`

### Contact notifications

- [Contact handler](https://github.com/with-alif/alif_protfolio/blob/main/config/mailer.js): browser mail client · `config/mailer.js`
- [EmailJS config](https://github.com/with-alif/alif_protfolio/blob/main/config/config.js): client configuration · `config/config.js`
- **EmailJS**: external email service
- [Telegram endpoint](https://github.com/with-alif/alif_protfolio/blob/main/api/telegram.js): Vercel serverless function · Keeps Telegram credentials server-side. · `api/telegram.js`
- **Telegram Bot API**: external messaging API

## Connections

- Public entry → Browser bootstrap: loads
- Browser bootstrap → Page composition: starts
- Page composition → Application core: coordinates
- Application core → Portfolio sections: renders
- Application core → Projects UI: renders
- Application core → Service interactions: renders
- Projects UI → Tag interactions: uses
- Portfolio sections → Content loader: loads content
- Projects UI → Content loader: loads projects
- Content loader → Supabase client: queries through
- Supabase client → Supabase: accesses
- Admin login → Admin authentication: loads
- Admin authentication → Supabase client: authenticates via
- Admin authentication → Content dashboard: authorizes access
- Content dashboard → Supabase client: CRUD operations
- Portfolio sections → Contact handler: submits contact
- Contact handler → EmailJS config: uses
- Contact handler → EmailJS: delivers email
- Contact handler → Telegram endpoint: notifies
- Telegram endpoint → Telegram Bot API: calls with server env
