# firaapriliana/porto_fi architecture

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

- Interactive diagram: https://gitdiagram.com/firaapriliana/porto_fi
- Repository: https://github.com/firaapriliana/porto_fi

## Overview

1. This repository is a small single-page frontend app, not a multi-service system. The whole runtime lives in the browser, with a local development/build layer provided by Vite.

2. The application entrypoint is `src/main.tsx`, which bootstraps the React app and mounts it into `index.html`. That file is the browser container for the app.

3. `src/App.tsx` is the top-level UI composition point. In an architecture diagram, this should be the central application node that coordinates all page-level rendering and user interaction.

4. `src/types.ts` is the shared shape boundary for the app’s data. Its presence suggests the UI exchanges structured objects internally rather than passing loose values around.

5. `src/index.css` is the global styling layer. It likely defines app-wide layout and visual rules rather than component-scoped styles, so it sits beside the React tree as a cross-cutting presentation concern.

6. `src/assets/images` holds static image assets used by the UI. These are bundled by Vite at build time and do not represent runtime services.

7. The main external dependency boundary is Google’s Gemini API. The README explicitly requires `GEMINI_API_KEY`, so the frontend depends on an external AI service for core functionality. The API key is provided through local environment configuration, not hardcoded in source.

8. Configuration and secret management are handled through environment files: `.env.example` documents the expected variables, while `.env.local` is used for the actual developer secret. This is the repo’s only clear backend-like boundary.

9. `package.json`, `vite.config.ts`, and `tsconfig.json` define the toolchain rather than business logic. They establish a TypeScript + React + Vite build pipeline, development server, and type-checking behavior.

10. `metadata.json` and the AI Studio README indicate this project is meant to be run and deployed as an AI Studio app. That suggests the deployment target is a hosted frontend app with external API access, rather than a custom server.

11. The data flow is simple: user interacts with the React UI in `App.tsx`, the app reads local configuration from environment variables, then sends requests to Gemini and renders the returned results back into the same client UI. There is no repository-local backend or database layer visible in the tree.

12. For an architecture diagram, the main boxes are: Browser/HTML shell, React app (`main.tsx` + `App.tsx`), shared types, static assets/styles, environment config, and the external Gemini API. The primary boundary to emphasize is “client-only UI calling a third-party AI service.”

Main entry points: [`src/App.tsx`](https://github.com/firaapriliana/porto_fi/blob/main/src/App.tsx) (App UI), [`index.html`](https://github.com/firaapriliana/porto_fi/blob/main/index.html) (HTML shell), [`package.json`](https://github.com/firaapriliana/porto_fi/blob/main/package.json) (Packages), [`metadata.json`](https://github.com/firaapriliana/porto_fi/blob/main/metadata.json) (AI Studio metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_browser(("Browser<br/>host<br/>[index.html]"))
  node_index_html["HTML shell<br/>entry<br/>[index.html]"]
  node_main_tsx["App boot<br/>bootstrap<br/>[main.tsx]"]
  node_app_tsx["App UI<br/>react-root<br/>[App.tsx]"]
  node_types_ts["Shared types<br/>schema<br/>[types.ts]"]
  node_index_css["Global styles<br/>[index.css]"]
  node_images[("Images<br/>assets")]
end

subgraph group_tooling["Tooling"]
  node_package_json["Packages<br/>deps<br/>[package.json]"]
  node_vite_config["Vite config<br/>build-config<br/>[vite.config.ts]"]
  node_tsconfig["TypeScript config<br/>type-config<br/>[tsconfig.json]"]
end

subgraph group_integration["Integration"]
  node_env_example["Env example<br/>config<br/>[.env.example]"]
  node_gemini_api[("Gemini API<br/>external-ai")]
  node_metadata_json["AI Studio metadata<br/>deployment-metadata<br/>[metadata.json]"]
end

node_browser -->|"loads"| node_index_html
node_index_html -->|"mounts"| node_main_tsx
node_main_tsx -->|"renders"| node_app_tsx
node_app_tsx -->|"uses"| node_types_ts
node_app_tsx -->|"styles"| node_index_css
node_app_tsx -->|"reads"| node_images
node_app_tsx -.->|"configures"| node_env_example
node_app_tsx -->|"calls"| node_gemini_api
node_env_example -.->|"key for"| node_gemini_api
node_package_json -->|"drives"| node_vite_config
node_package_json -->|"drives"| node_tsconfig
node_vite_config -->|"serves"| node_index_html
node_metadata_json -.->|"targets"| node_browser
node_metadata_json -.->|"integrates"| node_gemini_api

click node_browser "https://github.com/firaapriliana/porto_fi/blob/main/index.html"
click node_index_html "https://github.com/firaapriliana/porto_fi/blob/main/index.html"
click node_main_tsx "https://github.com/firaapriliana/porto_fi/blob/main/src/main.tsx"
click node_app_tsx "https://github.com/firaapriliana/porto_fi/blob/main/src/App.tsx"
click node_types_ts "https://github.com/firaapriliana/porto_fi/blob/main/src/types.ts"
click node_index_css "https://github.com/firaapriliana/porto_fi/blob/main/src/index.css"
click node_images "https://github.com/firaapriliana/porto_fi/tree/main/src/assets/images"
click node_env_example "https://github.com/firaapriliana/porto_fi/blob/main/.env.example"
click node_metadata_json "https://github.com/firaapriliana/porto_fi/blob/main/metadata.json"
click node_package_json "https://github.com/firaapriliana/porto_fi/blob/main/package.json"
click node_vite_config "https://github.com/firaapriliana/porto_fi/blob/main/vite.config.ts"
click node_tsconfig "https://github.com/firaapriliana/porto_fi/blob/main/tsconfig.json"

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_browser,node_index_html,node_main_tsx,node_app_tsx,node_types_ts,node_index_css,node_images toneBlue
class node_package_json,node_vite_config,node_tsconfig toneAmber
class node_env_example,node_gemini_api,node_metadata_json toneMint
```

## Components

### Runtime

Client-side app and browser shell

- [Browser](https://github.com/firaapriliana/porto_fi/blob/main/index.html): host · Browser runtime that loads the app · `index.html`
- [HTML shell](https://github.com/firaapriliana/porto_fi/blob/main/index.html): entry · App container and mount point · `index.html`
- [App boot](https://github.com/firaapriliana/porto_fi/blob/main/src/main.tsx): bootstrap · React entrypoint that mounts the app · `src/main.tsx`
- [App UI](https://github.com/firaapriliana/porto_fi/blob/main/src/App.tsx): react-root · Top-level UI composition and interaction · `src/App.tsx`
- [Shared types](https://github.com/firaapriliana/porto_fi/blob/main/src/types.ts): schema · Common data shapes used inside the UI · `src/types.ts`
- [Global styles](https://github.com/firaapriliana/porto_fi/blob/main/src/index.css): style · App-wide presentation and layout rules · `src/index.css`
- [Images](https://github.com/firaapriliana/porto_fi/tree/main/src/assets/images): assets · Static image assets bundled with the app · `src/assets/images`

### Tooling

Build, type, and deployment configuration

- [Packages](https://github.com/firaapriliana/porto_fi/blob/main/package.json): deps · Runtime and build dependencies · `package.json`
- [Vite config](https://github.com/firaapriliana/porto_fi/blob/main/vite.config.ts): build-config · Dev server and build pipeline settings · `vite.config.ts`
- [TypeScript config](https://github.com/firaapriliana/porto_fi/blob/main/tsconfig.json): type-config · Type-checking and compiler settings · `tsconfig.json`

### Integration

External AI and local environment boundary

- [Env example](https://github.com/firaapriliana/porto_fi/blob/main/.env.example): config · Documented environment variables and secrets · `.env.example`
- **Gemini API**: external-ai · Third-party AI service used by the app
- [AI Studio metadata](https://github.com/firaapriliana/porto_fi/blob/main/metadata.json): deployment-metadata · Deployment-oriented app metadata · `metadata.json`

## Connections

- Browser → HTML shell: loads · Browser opens the HTML shell
- HTML shell → App boot: mounts · HTML provides the app mount target
- App boot → App UI: renders · Bootstraps the React application
- App UI → Shared types: uses · Shares structured data shapes
- App UI → Global styles: styles · Applies global presentation rules
- App UI → Images: reads · Uses bundled image assets
- App UI → Env example: configures · Depends on documented environment variables
- App UI → Gemini API: calls · Sends user-driven requests to the AI service
- Env example → Gemini API: key for · Documents the API key required for access
- Packages → Vite config: drives · Project dependencies support the Vite toolchain
- Packages → TypeScript config: drives · TypeScript tooling is defined by project setup
- Vite config → HTML shell: serves · Vite builds and serves the browser entry
- AI Studio metadata → Browser: targets · Metadata indicates hosted frontend deployment
- AI Studio metadata → Gemini API: integrates · Deployment expects external AI access
