How eugeniozucal/aiworkify-website works
Project type & purpose (from README + tree)
This is a single-page frontend web app built with React + TypeScript and bundled/dev-served with Vite. Its purpose is an “AI Studio app” that likely calls Google Gemini via an API key (GEMINI_API_KEY in .env.local). There is no backend service in this repo; any AI calls are either:
• done directly from the browser to Gemini (less common for production unless proxied), or
• proxied through Vite dev server tooling / serverless endpoint (but the tree does not show a server folder, so assume browser-to-Gemini unless you find otherwise in code).
Entry / bootstrap layer
• index.html — static HTML shell.
• index.tsx — React bootstrap (creates root, mounts App).
• App.tsx — top-level composition and routing/state boundaries (even if no router is used).
UI / component layer
• components/* — presentational + feature components:
• HeroDashboard.tsx, Features.tsx, Integrations.tsx, Footer.tsx, Button.tsx
Build / tooling / runtime config
• vite.config.ts — bundler/dev server configuration (and possibly proxy rules).
• tsconfig*.json — compilation settings.
• package.json — scripts (dev, build) and dependencies.
• metadata.json — AI Studio app metadata (treat as deployment/config artifact).
React SPA (this repo)
• served as static assets (Vite dev server in dev; static host in prod)
Config/Secrets
• .env.local (dev) / environment variables (deployment)
• User → React SPA: “HTTP(S) GET static assets”
• React SPA → Gemini API: “HTTPS API calls (prompt/request)”
• Config → React SPA: “GEMINI_API_KEY injected at build/runtime (verify mechanism)”
• React SPA → Vite Dev Server Proxy → Gemini API
Inside “React SPA”, break it into:
• Bootstrap
• index.html
• index.tsx
• App Composition
• App.tsx
• UI Components
• HeroDashboard
• Features
• Integrations
• Footer
• Button
• Types/Models
• types.ts
• AI Client / API Integration
• Build/Tooling (non-runtime)
• index.tsx → App.tsx (mount)
• App.tsx → Components (composition)
• Components ↔ App state (props/events)
• “AI Client” ↔ Gemini API (network)
• types.ts → App/Components/AI Client (compile-time contract)
Architectural patterns / principles to highlight
• Component-based UI architecture (React): App.tsx composes feature components.
• Separation of concerns (lightweight here):
• UI components in components/
• Types in types.ts
• Tooling/build config separated in root configs
• Config as dependency: the API key is a dependency edge.
• “Prompt/Response Adapter” module between UI and Gemini API.
System Context (C4 Level 1)
User ↔ React SPA ↔ Gemini API, with Env Config feeding SPA (or proxy).
Container/Component View (C4 Level 2-ish)
Inside SPA: Bootstrap → App → Components; App/Component → AI Client → Gemini; Types used across; Build pipeline shown separately.
This approach stays faithful to the repo, is detailed, and captures the essential architecture without inventing missing services.