AdvisorAI Directory Structure Overview
===================================

Root Directory
--------------
This repository is organized into two main application areas:
1) client/  -> Frontend (React + TypeScript + Vite)
2) server/  -> Backend API (.NET)

Also includes solution and project-level files used for development, builds,
and deployment configuration.


Top-Level Files
---------------
- README.md
  High-level project setup and run instructions.

- AdvisorAI.slnx
  Solution file that groups backend and test projects for .NET tooling.

Frontend (client/)
------------------
The client folder contains the web application users interact with.

- src/
  Main frontend source code.

  - pages/
    Route-level page components (for example home and chat pages).

  - components/
    Reusable UI components grouped by feature (HomePage, ChatPage, Sidebar,
    chat window components, modals, upload controls, etc.).

  - hooks/
    Custom React hooks for application logic such as chat state management,
    API request handling, and UI behavior helpers.

  - assets/
    Static UI assets and icon components.

  - main.tsx, App.tsx, index.css
    Frontend entry point, root app composition, and global styles.

- public/
  Static files copied directly into the final frontend build output.

- package.json
  Frontend dependencies and scripts (dev, build, lint, preview).

- vite.config.ts, tsconfig*.json, eslint.config.js, tailwind.config.js
  Build tooling, TypeScript settings, linting, and style system configuration.


Backend (server/)
-----------------
The server folder contains the API, AI orchestration logic, parsing services,
and deployment configuration.

- Program.cs
  Backend startup and dependency injection wiring.

- Controllers/
  HTTP API endpoints for major backend features:
  - AuditController.cs
  - ChatController.cs
  - FlowchartController.cs

- Services/
  Business logic and integrations, including:
  - Chat orchestration
  - Embeddings and vector retrieval
  - PDF/flowchart parsing
  - Redis-backed chat history
  - Interface contracts for testability and abstraction

- Models/
  Data contracts and domain objects used by controllers/services.

- Properties/launchSettings.json
  Local launch profiles for development.

- appsettings.json, appsettings.Development.json
  Runtime configuration (with secret placeholders, not real keys).

- Dockerfile, web.config
  Containerization and hosting configuration.


Backend Tests (server/Tests/)
-----------------------------
Unit tests for backend behavior.

- server.Tests.csproj
  MSTest test project definition.

- Controllers/
  Unit tests for API controller behavior and validation.

- Services/
  Unit tests for parser and service configuration guards.

- TestHelpers/
  Shared utilities used by tests (for example generated in-memory PDF helper).


Generated/Build Artifacts
-------------------------
Some directories are generated by tooling and are not source-of-truth code:
- client/dist/
- server/bin/, server/obj/
- server/Tests/bin/, server/Tests/obj/


Architecture Summary
--------------------
- The frontend sends user input/files to backend API endpoints.
- The backend parses documents, retrieves context from vector storage,
  and orchestrates AI responses.
- Redis stores temporary chat history context.
- Deployment typically hosts frontend and backend separately, with frontend
  calling backend through a configured API base URL.