# agmyyy/front-biotech-projectweb architecture

> Architecture diagram of the GitHub repository agmyyy/front-biotech-projectweb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/agmyyy/front-biotech-projectweb
- Repository: https://github.com/agmyyy/front-biotech-projectweb

## Overview

This is a biotechnology question-and-answer web platform: users authenticate, submit searches in chat, receive structured answers, manage conversation sessions, and rate responses. The frontend provides the dashboard, progressive answer presentation, and collapsible history; the NestJS API handles authentication, query orchestration, mock multi-agent answers, sessions, and feedback over in-memory state. Shared Zod schemas define request and response shapes. The README documents WebSocket infrastructure, but sampled evidence does not establish its runtime connection; the agent system and storage are explicitly mock implementations.

Main entry points: [`frontend/src/components/dashboard/dashboard.tsx`](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/dashboard/dashboard.tsx) (Chat dashboard), [`backend/src/queries/queries.service.ts`](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/queries/queries.service.ts) (Query orchestration), [`frontend/src/services/api-client.ts`](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/api-client.ts) (HTTP client), [`backend/src/database/mock.service.ts`](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/database/mock.service.ts) (In-memory state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_auth_pages["Login and signup<br/>[page.tsx]"]
  node_dashboard["Chat dashboard<br/>[dashboard.tsx]"]
  node_search_flow["Search control<br/>[use-search.ts]"]
  node_answer_view["Answer display<br/>[search-result.tsx]"]
  node_typewriter["Typewriter effect<br/>[use-typewriter.ts]"]
  node_history["Session sidebar<br/>[chat-list.tsx]"]
  node_rating["Star feedback"]
  node_auth_service_ui["Auth client<br/>[auth-service.ts]"]
  node_search_service_ui["Search client<br/>[search-service.ts]"]
  node_chat_service_ui["Chat client<br/>[chat-service.ts]"]
  node_api_client["HTTP client<br/>[api-client.ts]"]
end

subgraph group_backend["API and domain"]
  node_auth_controller["Auth endpoints<br/>[auth.controller.ts]"]
  node_auth_service["JWT authentication<br/>[auth.service.ts]"]
  node_query_controller["Query endpoints"]
  node_session_controller["Session endpoints"]
  node_query_service["Query orchestration<br/>[queries.service.ts]"]
  node_mas_service["Mock answer engine<br/>[mas.service.ts]"]
  node_feedback_controller["Feedback endpoints"]
  node_feedback_service["Feedback logic"]
  node_websocket["WebSocket gateway<br/>[events.gateway.ts]"]
end

subgraph group_state["Mock state"]
  node_mock_store[("In-memory state<br/>[mock.service.ts]")]
end

subgraph group_contracts["Shared contracts"]
  node_query_schema["Query schemas<br/>[query.schema.ts]"]
  node_auth_schema["Auth schemas<br/>[auth.schema.ts]"]
  node_feedback_schema["Feedback schema<br/>[feedback.schema.ts]"]
end

node_user(("User"))
node_api["NestJS API"]

node_user -.->|"registers or logs in"| node_auth_pages
node_user -.->|"asks questions"| node_dashboard
node_dashboard -.->|"uses search"| node_search_flow
node_search_flow -.->|"submits query"| node_search_service_ui
node_search_service_ui -->|"calls HTTP"| node_api_client
node_auth_pages -.->|"uses auth"| node_auth_service_ui
node_auth_service_ui -->|"calls HTTP"| node_api_client
node_api_client -->|"sends requests"| node_api
node_api -.->|"routes auth"| node_auth_controller
node_api -.->|"routes queries"| node_query_controller
node_api -.->|"routes sessions"| node_session_controller
node_api -.->|"routes feedback"| node_feedback_controller
node_auth_controller -->|"delegates to"| node_auth_service
node_auth_service -->|"reads and writes"| node_mock_store
node_query_controller -->|"delegates to"| node_query_service
node_query_service -->|"reads and writes"| node_mock_store
node_query_service -->|"processes query"| node_mas_service
node_query_service -->|"dispatches events"| node_websocket
node_session_controller -->|"manages sessions"| node_mock_store
node_feedback_controller -->|"delegates to"| node_feedback_service
node_feedback_service -->|"reads and writes"| node_mock_store
node_query_controller -->|"validates with"| node_query_schema
node_session_controller -->|"validates with"| node_query_schema
node_auth_controller -->|"validates with"| node_auth_schema
node_feedback_controller -->|"validates with"| node_feedback_schema
node_dashboard -.->|"shows results"| node_answer_view
node_answer_view -.->|"animates text"| node_typewriter
node_dashboard -.->|"shows history"| node_history
node_dashboard -.->|"manages chat"| node_chat_service_ui
node_dashboard -.->|"offers rating"| node_rating
node_chat_service_ui -.->|"calls HTTP"| node_api_client

click node_auth_pages "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/app/login/page.tsx"
click node_dashboard "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/dashboard/dashboard.tsx"
click node_search_flow "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/hooks/control/use-search.ts"
click node_answer_view "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/chat/search-result.tsx"
click node_typewriter "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/hooks/use-typewriter.ts"
click node_history "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/sidebar/chat-list.tsx"
click node_rating "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/feedback/feedback-rating.tsx"
click node_auth_service_ui "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/auth-service.ts"
click node_search_service_ui "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/search-service.ts"
click node_chat_service_ui "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/chat-service.ts"
click node_api_client "https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/api-client.ts"
click node_auth_controller "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/auth/auth.service.ts"
click node_query_controller "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/queries/queries.controller.ts"
click node_session_controller "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/queries/sessions.controller.ts"
click node_query_service "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/queries/queries.service.ts"
click node_mas_service "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/mas/mas.service.ts"
click node_feedback_controller "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/feedback/feedback.controller.ts"
click node_feedback_service "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/feedback/feedback.service.ts"
click node_websocket "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/events/events.gateway.ts"
click node_mock_store "https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/database/mock.service.ts"
click node_query_schema "https://github.com/agmyyy/front-biotech-projectweb/blob/main/shared/schemas/query.schema.ts"
click node_auth_schema "https://github.com/agmyyy/front-biotech-projectweb/blob/main/shared/schemas/auth.schema.ts"
click node_feedback_schema "https://github.com/agmyyy/front-biotech-projectweb/blob/main/shared/schemas/feedback.schema.ts"

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_auth_pages,node_dashboard,node_search_flow,node_answer_view,node_typewriter,node_history,node_rating,node_auth_service_ui,node_search_service_ui,node_chat_service_ui,node_api_client,node_user toneBlue
class node_auth_controller,node_auth_service,node_query_controller,node_session_controller,node_query_service,node_mas_service,node_feedback_controller,node_feedback_service,node_websocket toneAmber
class node_mock_store,node_api toneMint
class node_query_schema,node_auth_schema,node_feedback_schema toneRose
```

## Components

### Web application

- [Login and signup](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/app/login/page.tsx): `frontend/src/app/login/page.tsx`
- [Chat dashboard](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/dashboard/dashboard.tsx): `frontend/src/components/dashboard/dashboard.tsx`
- [Search control](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/hooks/control/use-search.ts): `frontend/src/hooks/control/use-search.ts`
- [Answer display](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/chat/search-result.tsx): `frontend/src/components/chat/search-result.tsx`
- [Typewriter effect](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/hooks/use-typewriter.ts): `frontend/src/hooks/use-typewriter.ts`
- [Session sidebar](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/sidebar/chat-list.tsx): `frontend/src/components/sidebar/chat-list.tsx`
- [Star feedback](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/components/feedback/feedback-rating.tsx): `frontend/src/components/feedback/feedback-rating.tsx`
- [Auth client](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/auth-service.ts): `frontend/src/services/auth-service.ts`
- [Search client](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/search-service.ts): `frontend/src/services/search-service.ts`
- [Chat client](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/chat-service.ts): `frontend/src/services/chat-service.ts`
- [HTTP client](https://github.com/agmyyy/front-biotech-projectweb/blob/main/frontend/src/services/api-client.ts): `frontend/src/services/api-client.ts`

### API and domain

- [Auth endpoints](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/auth/auth.controller.ts): `backend/src/auth/auth.controller.ts`
- [JWT authentication](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [Query endpoints](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/queries/queries.controller.ts): `backend/src/queries/queries.controller.ts`
- [Session endpoints](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/queries/sessions.controller.ts): `backend/src/queries/sessions.controller.ts`
- [Query orchestration](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/queries/queries.service.ts): `backend/src/queries/queries.service.ts`
- [Mock answer engine](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/mas/mas.service.ts): `backend/src/mas/mas.service.ts`
- [Feedback endpoints](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/feedback/feedback.controller.ts): `backend/src/feedback/feedback.controller.ts`
- [Feedback logic](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/feedback/feedback.service.ts): `backend/src/feedback/feedback.service.ts`
- [WebSocket gateway](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/events/events.gateway.ts): `backend/src/events/events.gateway.ts`

### Mock state

- [In-memory state](https://github.com/agmyyy/front-biotech-projectweb/blob/main/backend/src/database/mock.service.ts): `backend/src/database/mock.service.ts`

### Shared contracts

- [Query schemas](https://github.com/agmyyy/front-biotech-projectweb/blob/main/shared/schemas/query.schema.ts): `shared/schemas/query.schema.ts`
- [Auth schemas](https://github.com/agmyyy/front-biotech-projectweb/blob/main/shared/schemas/auth.schema.ts): `shared/schemas/auth.schema.ts`
- [Feedback schema](https://github.com/agmyyy/front-biotech-projectweb/blob/main/shared/schemas/feedback.schema.ts): `shared/schemas/feedback.schema.ts`

### Other components

- **User**
- **NestJS API**

## Connections

- User → Login and signup: registers or logs in (evidence: `README.md`)
- User → Chat dashboard: asks questions (evidence: `README.md`)
- Chat dashboard → Search control: uses search
- Search control → Search client: submits query
- Search client → HTTP client: calls HTTP (evidence: `frontend/src/services/search-service.ts`)
- Login and signup → Auth client: uses auth (evidence: `README.md`)
- Auth client → HTTP client: calls HTTP (evidence: `frontend/src/services/auth-service.ts`)
- HTTP client → NestJS API: sends requests (evidence: `frontend/src/services/api-client.ts`)
- NestJS API → Auth endpoints: routes auth (evidence: `README.md`)
- NestJS API → Query endpoints: routes queries (evidence: `README.md`)
- NestJS API → Session endpoints: routes sessions (evidence: `README.md`)
- NestJS API → Feedback endpoints: routes feedback (evidence: `README.md`)
- Auth endpoints → JWT authentication: delegates to (evidence: `backend/src/auth/auth.controller.ts`)
- JWT authentication → In-memory state: reads and writes (evidence: `backend/src/auth/auth.service.ts`)
- Query endpoints → Query orchestration: delegates to (evidence: `backend/src/queries/queries.controller.ts`)
- Query orchestration → In-memory state: reads and writes (evidence: `backend/src/queries/queries.service.ts`)
- Query orchestration → Mock answer engine: processes query (evidence: `backend/src/queries/queries.service.ts`)
- Query orchestration → WebSocket gateway: dispatches events (evidence: `backend/src/queries/queries.service.ts`)
- Session endpoints → In-memory state: manages sessions (evidence: `backend/src/queries/sessions.controller.ts`)
- Feedback endpoints → Feedback logic: delegates to (evidence: `backend/src/feedback/feedback.controller.ts`)
- Feedback logic → In-memory state: reads and writes (evidence: `backend/src/feedback/feedback.service.ts`)
- Query endpoints → Query schemas: validates with (evidence: `backend/src/queries/queries.controller.ts`)
- Session endpoints → Query schemas: validates with (evidence: `backend/src/queries/sessions.controller.ts`)
- Auth endpoints → Auth schemas: validates with (evidence: `backend/src/auth/auth.controller.ts`)
- Feedback endpoints → Feedback schema: validates with (evidence: `backend/src/feedback/feedback.controller.ts`)
- Chat dashboard → Answer display: shows results (evidence: `README.md`)
- Answer display → Typewriter effect: animates text (evidence: `README.md`)
- Chat dashboard → Session sidebar: shows history (evidence: `README.md`)
- Chat dashboard → Chat client: manages chat
- Chat dashboard → Star feedback: offers rating (evidence: `README.md`)
- Chat client → HTTP client: calls HTTP
