Flowmindmap
Welcome to your Lovable project Project info URL: https://lovable.dev/projects/4470f2ac-931e-4123-b8a5-cedb40bc0d2f How can I edit this code? There are several ways of editing your...
Technical Architecture & Engineering Overview
Detailed system design and core implementation
The front‑end is built as a single‑page application using React with React Router for navigation between the main index, roadmaps, and shortcuts pages. Global providers such as QueryClientProvider, ThemeProvider, and TooltipProvider wrap the component tree, establishing a consistent data‑fetching, theming, and UI‑feedback layer. Each page imports shared UI primitives from the components/ui library, ensuring a cohesive design system powered by TailwindCSS utilities.
AI generation is orchestrated through src/utils/aiProviderApi.ts. The module selects the appropriate endpoint based on the chosen provider, constructs a request payload that includes a system prompt (“You are a helpful AI assistant that creates detailed mindmaps in JSON format.”), and parses the response into a unified result shape. Error handling is explicit: non‑OK HTTP responses raise descriptive exceptions, and provider‑specific response validation (e.g., Gemini’s candidates[0].content.parts[0].text) guards against malformed data.
The Carousel component demonstrates advanced React patterns: it creates a context (CarouselContext) that exposes the Embla API, scroll controls, and orientation logic. Consumers invoke useCarousel() to access scrollPrev, scrollNext, and state flags (canScrollPrev, canScrollNext). Keyboard navigation is captured via onKeyDownCapture, mapping arrow keys to carousel actions, which improves accessibility.
User configuration for AI providers lives in AIProviderForm.tsx. The form dynamically renders fields based on the selected provider (e.g., API key input for Gemini/Grok, server URL for Ollama/LM Studio) and populates model options from a constant map. This modular UI enables seamless switching between cloud and local AI services without code changes.
The build pipeline leverages Vite (implicit from the React setup) and TypeScript compilation, with linting enforced by ESLint. No backend services are present in the repository; all AI calls are performed client‑side, relying on CORS‑enabled endpoints or local servers.
System Diagrams & Flow Visualizations
Interactive Mermaid architecture & execution flows
Core System Features
Key capabilities & architectural features
AI‑driven mind‑map generation in JSON format
AI‑driven mind‑map generation in JSON format
Support for multiple AI providers (Gemini, Grok, Ollama, LM Studio)
Support for multiple AI providers (Gemini, Grok, Ollama, LM Studio)
Responsive carousel UI with horizontal/vertical orientation
Responsive carousel UI with horizontal/vertical orientation
Keyboard navigation for carousel (Arrow keys) and shortcuts (Escape)
Keyboard navigation for carousel (Arrow keys) and shortcuts (Escape)
Dynamic form fields that adapt to selected AI provider
Dynamic form fields that adapt to selected AI provider
TailwindCSS‑styled components for consistent visual design
TailwindCSS‑styled components for consistent visual design
React Query caching and retry logic for API calls
React Query caching and retry logic for API calls
Theme switching via `next-themes` (system, light, dark)
Theme switching via `next-themes` (system, light, dark)
Shortcut reference page with common editor commands
Shortcut reference page with common editor commands
Modular component library (`ui` folder) for reuse
Modular component library (`ui` folder) for reuse
Engineering Challenges & Solutions
Problem statements & resolution strategies
Balancing client‑side AI calls with CORS and authentication constraints
Balancing client‑side AI calls with CORS and authentication constraints
Normalizing disparate response schemas from different AI services
Normalizing disparate response schemas from different AI services
Ensuring carousel accessibility while maintaining performance
Ensuring carousel accessibility while maintaining performance
Managing state synchronization between Embla API and React state flags
Managing state synchronization between Embla API and React state flags
Providing a seamless UX when switching between cloud and local AI providers
Providing a seamless UX when switching between cloud and local AI providers
Key Code Modules & Architecture
Core file entrypoints and service responsibilities
srcModule component managing src source logic
src/componentsModule component managing components source logic
src/components/uiModule component managing ui source logic
src/hooksModule component managing hooks source logic
src/libModule component managing lib source logic
src/pagesModule component managing pages source logic
src/storeModule component managing store source logic
src/typesModule component managing types source logic
src/utilsModule component managing utils source logic
User Journey Pipeline
- 1User Access & Preset Selection: User opens client interface and configures request parameters or task workflow presets.
- 2Client Payload Dispatch: Front-end components (React, TailwindCSS) serialize input objects and send HTTP/WebSocket requests to `/api/analyze`.
- 3Middleware & Validation Check: API Gateway evaluates CORS headers, authorization tokens, and input validation schemas.
- 4Service & Inference Execution: Service controllers dispatch request frames to model inference engine (Local Engine) or storage layer.
- 5Response Delivery & State Synchronization: Serialized output payload is returned to the client and rendered in the visual workspace.
Execution Code Flow
- 1Entrypoint Invocation: Request enters network interface layer via `POST /api/analyze`.
- 2Schema & Guardrail Verification: Middleware sanitizes payload parameters and checks rate-limiting limits.
- 3Controller Dispatch: Router delegates validated object to `Src` service controller.
- 4Engine Execution & Storage Operations: Controller executes business logic, queries database models (Persistence), and invokes ML workers.
- 5Response Serialization: Result model is formatted into standard JSON response frame and delivered with HTTP 200 OK.
System FAQ & Technical Specifications
Frequently asked questions and core architecture details
Q: What technologies are used in Flowmindmap?
Flowmindmap is engineered using modern full-stack frameworks.
Q: What core engineering problem does Flowmindmap solve?
Welcome to your Lovable project Project info URL: https://lovable.dev/projects/4470f2ac-931e-4123-b8a5-cedb40bc0d2f How can I edit this code? There are several ways of editing your...
Q: How is 'Balancing client‑side AI calls with CORS and authentication constraints' resolved in Flowmindmap?
Resolved through specialized system architecture and resilient state handling.
Related Systems & Case Studies
Explore similar technical architectures and projects