How khyathivardhan18/ai-app works
Project type and purpose
• This is Edith AI App, an open-source, AI-powered Web IDE built entirely as a client-side Single-Page Application (SPA).
• It’s written in TypeScript + React + Vite, styled with Tailwind, integrates with Google Gemini AI for intelligent coding assistance, and is deployed as static assets via GitHub Pages / Netlify with a GitHub Actions CI/CD pipeline.
File structure
• Top-level:
• .github/workflows/deploy.yml – CI/CD
• public/ – static assets (404.html, redirects, CSS)
• src/
– components/ (UI pieces: IDELayout, FileTree, CodeEditor, AIChat, TerminalPanel, etc.)
– context/ (global AppContext state)
– services/ (external/API layer: gemini.ts)
– utils/ (browser compatibility & in-browser file system)
– types/ (TypeScript definitions)
• Configs: package.json, vite.config.ts, tsconfig.json, tailwind.config.js, netlify.toml
Key insights from README
• SPA with layered architecture: UI Components → React Context → Services → External AI
• Emphasis on environment-based API key injection
• Automated deployment via GitHub Actions
Main components & interactions
a. Browser / Client
• UI Layer (React Components)
• IDELayout (shell)
• FileTree (file explorer)
• CodeEditor (monaco or similar)
• AIChat / AgentMode (chat interface)
• TerminalPanel
• SettingsPage, WelcomePage, etc.
• State Layer (AppContext)
• Utilities
• In-browser FileSystem API wrappers
• Browser compatibility checks
b. Service Layer
• gemini.ts: wraps calls to Google Gemini AI endpoints
c. External Services
• Google Gemini AI (REST/GRPC)
• (Optional) GitHub/GitLab sync (future roadmap)
d. CI/CD & Hosting
• GitHub Actions → build (Vite) → deploy to GitHub Pages / Netlify
e. Static Asset Hosting
• GitHub Pages / Netlify serving index.html + JS/CSS bundles
Architectural patterns & design principles
• SPA Layering: UI → State → Services
• Component-Driven: each IDE feature is a self-contained React component
• Separation of Concerns:
• components/ only render UI
• context/ holds application state & dispatchers
• services/ handle all external API communication
• utils/ encapsulate low-level browser APIs
• Environment-Based Configuration: VITE_API_KEY injected at build time
• Static First: no backend—everything runs in the browser