Commit 16e081

2025-10-15 09:53:06 Rushikesh Jagdale: remove AI emojis
Projects/SkillShift/LLD.md ..
@@ 18,7 18,7 @@
The **frontend** is built using **React** and consumes REST APIs exposed by the FastAPI backend. It serves as the user interface for screens, chatbot interactions, and employee views.
- ### πŸ“ Repository Structure
+ ### Repository Structure
```bash
/repo
@@ 91,7 91,7 @@
---
- ### πŸ§‘β€πŸ’Ό **employees**
+ ### **employees**
```sql
CREATE TABLE employees (
@@ 112,7 112,7 @@
---
- ### πŸ’¬ Messages
+ ### Messages
```sql
CREATE EXTENSION IF NOT EXISTS vector;
@@ 133,7 133,7 @@
---
- ### 🏷️ Tags
+ ### Tags
```sql
CREATE TABLE tags (
@@ 150,7 150,7 @@
---
- ### πŸ”— Employee–Tag Relationship
+ ### Employee–Tag Relationship
```sql
CREATE TABLE employee_tag (
@@ 168,7 168,7 @@
---
- ### 🌐 Data Sources
+ ### Data Sources
```sql
CREATE TABLE data_sources (
@@ 189,7 189,7 @@
## API Contracts
- ### πŸ‘€ 1 GET /employee/{id}
+ ### 1 GET /employee/{id}
**Purpose:** Retrieve a specific employee’s profile (for dashboard view).
@@ 223,7 223,7 @@
---
- ### πŸ‘₯ 2 GET /employee
+ ### 2 GET /employee
**Purpose:** List all employees (Admin only).
@@ 253,7 253,7 @@
]
```
- ### πŸ’¬ 3 POST /message/bulk_ingest
+ ### 3 POST /message/bulk_ingest
**Purpose:** Store messages fetched from integrations (used by ingestion worker).
@@ 288,7 288,7 @@
- `400 Bad Request` β€” Invalid message structure.
- ### 🏷️ 4 POST /tag
+ ### 4 POST /tag
**Purpose:** Create or update a tag (Admin only).
@@ 309,7 309,7 @@
"tag": { "id": 3, "tag_name": "Project Alpha", "is_active": true }
}
```
- ### 🏷️ 5 GET /tag
+ ### 5 GET /tag
**Purpose:** Retrieve all active tags.
@@ 321,7 321,7 @@
{ "id": 5, "tag_name": "Knowledge Transfer" }
]
```
- ### 🏷️ 6 GET /tag/{id}
+ ### 6 GET /tag/{id}
**Purpose:** Get tag details with linked employees and data sources.
@@ 340,7 340,7 @@
}
```
- ### πŸ”— 7 POST /employee_tag
+ ### 7 POST /employee_tag
**Purpose:** Assign or unassign a tag to an employee (Admin only).
@@ 361,7 361,7 @@
}
```
- ### πŸ”— 8 GET /employee_tag/{employee_id}
+ ### 8 GET /employee_tag/{employee_id}
**Purpose:** Fetch all tags assigned to a specific employee.
@@ 377,7 377,7 @@
}
```
- ### 🌐 9 POST /data_source
+ ### 9 POST /data_source
**Purpose:** Add or update a chat data source.
@@ 409,7 409,7 @@
}
```
- ### 🌐 10 GET /data_source
+ ### 10 GET /data_source
**Purpose:** List all configured data sources with their associated tags.
@@ 434,7 434,7 @@
]
```
- ### 🌐 11 GET /data_source/{id}
+ ### 11 GET /data_source/{id}
**Purpose:** Get details of a specific data source.
@@ 452,7 452,7 @@
}
```
- ### πŸ€– 12 POST /chatbot/query
+ ### 12 POST /chatbot/query
**Purpose:** Submit a natural language query to the AI assistant.
@@ 480,7 480,7 @@
}
```
- ### 🧭 13 GET /admin/overview
+ ### 13 GET /admin/overview
**Purpose:** Retrieve system overview for Admin dashboard.
@@ 512,7 512,7 @@
---
- ## 🧱 1️⃣ Models Layer (ORM – Database Mapping)
+ ## 1 Models Layer (ORM – Database Mapping)
Defines ORM entities using SQLAlchemy, each mapped to a database table.
@@ 538,7 538,7 @@
---
- ## 🧾 2️⃣ Schemas Layer (Pydantic Models)
+ ## 2 Schemas Layer (Pydantic Models)
Defines data validation and serialization classes for API input/output.
@@ 569,7 569,7 @@
---
- ## 🧠 3️⃣ Service Layer (Business Logic)
+ ## 3 Service Layer (Business Logic)
Implements all application logic β€” CRUD operations, AI processing, and integrations.
@@ 613,7 613,7 @@
---
- ## 🌐 4️⃣ Routes Layer (FastAPI Endpoints)
+ ## 4 Routes Layer (FastAPI Endpoints)
Defines REST API endpoints; connects incoming requests to service methods.
@@ 646,7 646,7 @@
---
- ## πŸ› οΈ 5️⃣ Utility Layer (Helper Modules)
+ ## 5 Utility Layer (Helper Modules)
Provides shared functionality for embeddings, sanitization, security, and configuration.
@@ 674,7 674,7 @@
---
- ## ⏰ 6️⃣ Scheduler Layer (Cron & Background Jobs)
+ ## 6 Scheduler Layer (Cron & Background Jobs)
Handles periodic and background operations such as message ingestion and cleanup.
@@ 875,40 875,40 @@
### Week 1 β€” Core Backend Setup
**Objectives:**
- βœ… Define and create DB schema: `employees`, `messages`, `tags`, `employee_tag`, `data_sources`.
- βœ… Set up FastAPI project structure (models, schemas, routes, services).
- βœ… Implement JWT authentication and role-based access (`is_admin`).
- βœ… Build core CRUD APIs: `/employee`, `/tag`, `/employee_tag`, `/data_source`.
- βœ… Setup PostgreSQL + pgvector in Docker Compose.
- βœ… Test all endpoints via Postman.
+ - Define and create DB schema: `employees`, `messages`, `tags`, `employee_tag`, `data_sources`.
+ - Set up FastAPI project structure (models, schemas, routes, services).
+ - Implement JWT authentication and role-based access (`is_admin`).
+ - Build core CRUD APIs: `/employee`, `/tag`, `/employee_tag`, `/data_source`.
+ - Setup PostgreSQL + pgvector in Docker Compose.
+ - Test all endpoints via Postman.
### Week 2 β€” Ingestion & AI Layer
**Objectives:**
- βœ… Implement message ingestion pipeline:
+ Implement message ingestion pipeline:
- `/message/bulk_ingest` endpoint
- `nlp_worker` for sanitization (remove PII, links, emojis)
- Generate embeddings (SentenceTransformer)
- βœ… Store cleaned messages and embeddings in DB.
- βœ… Build ChatbotService:
+ Store cleaned messages and embeddings in DB.
+ Build ChatbotService:
- Vector search for similar messages
- Summarize top matches (basic LLM/OpenAI API)
- βœ… Unit tests for message ingestion and chatbot logic
+ Unit tests for message ingestion and chatbot logic
### Week 3 β€” Frontend & Integration
**Objectives:**
- βœ… Create minimal React/Next.js frontend:
+ Create minimal React/Next.js frontend:
- Employee Dashboard: Profile + AI Chatbot
- Admin Dashboard: Manage Employees, Tags, Data Sources
- βœ… Integrate frontend with backend APIs.
- βœ… Implement `/chatbot/query` UI β†’ Backend connection.
- βœ… Add health checks, structured logging, and final testing.
- βœ… Prepare MVP demo.
+ - Integrate frontend with backend APIs.
+ - Implement `/chatbot/query` UI β†’ Backend connection.
+ - Add health checks, structured logging, and final testing.
+ - Prepare MVP demo.
### Week 4 β€” Testing, Fixes & Demo
**Objectives:**
- βœ… Conduct end-to-end system testing (API + UI + AI flow).
- βœ… Fix API bugs, UI alignment, and edge cases.
- βœ… Add basic logging, health checks, and monitoring scripts.
- βœ… Conduct user acceptance testing (UAT) internally.
- βœ… Prepare final demo build via Docker Compose.
- βœ… MVP presentation and walkthrough.
+ - Conduct end-to-end system testing (API + UI + AI flow).
+ - Fix API bugs, UI alignment, and edge cases.
+ - Add basic logging, health checks, and monitoring scripts.
+ - Conduct user acceptance testing (UAT) internally.
+ - Prepare final demo build via Docker Compose.
+ - MVP presentation and walkthrough.
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9