diff --git a/.gitignore b/.gitignore index 600e365..1eb2866 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -**/node_modules \ No newline at end of file +**/node_modules +.history/ \ No newline at end of file diff --git a/frontend/.agents/contexts/OVERVIEW.md b/frontend/.agents/contexts/OVERVIEW.md index a12a6f2..9d85071 100644 --- a/frontend/.agents/contexts/OVERVIEW.md +++ b/frontend/.agents/contexts/OVERVIEW.md @@ -96,7 +96,7 @@ Instead, it uses a layered architecture where responsibilities are separated by - component layer - core layer - hooks layer -- services layer +- core services layer - pages layer - models layer @@ -118,7 +118,7 @@ The application is divided into multiple architecture layers: | `core/` | Shared infrastructure and configuration | | `hooks/` | Reusable React hooks | | `pages/` | Route/page-level components | -| `services/` | API communication | +| `core/services/` | API communication | | `models/` | Shared TypeScript models | | `styles/` | Global styling | | `locales/` | Internationalization | @@ -183,7 +183,7 @@ The project architecture separates concerns by technical responsibility instead | Layer | Main Purpose | | ------------- | -------------------------------------- | | `components/` | Shared reusable UI | -| `services/` | API requests and backend communication | +| `core/services/` | API requests and backend communication | | `hooks/` | Shared reusable logic | | `pages/` | Route composition | | `core/` | Shared infrastructure | @@ -259,10 +259,6 @@ The architecture is designed to ensure: │ │ ├── dashboard/ │ │ └── home/ │ │ -│ ├── services/ # API services -│ │ ├── auth.service.ts -│ │ └── user.service.ts -│ │ │ ├── styles/ # Global styles │ │ ├── globals.css │ │ └── tailwind.css @@ -416,15 +412,15 @@ Rules: --- -## 9.8 `src/services/` +## 9.8 `src/core/services/` Contains backend communication logic. Examples: ```txt -auth.service.ts -user.service.ts +src/core/services/auth.service.ts +src/core/services/cv.service.ts ``` Responsibilities: @@ -479,13 +475,13 @@ Use Zustand for: # 11. API Architecture -API communication should remain centralized inside the `services/` layer. +API communication should remain centralized inside the `core/services/` layer. Examples: ```txt -auth.service.ts -user.service.ts +src/core/services/auth.service.ts +src/core/services/cv.service.ts ``` Responsibilities include: @@ -574,9 +570,9 @@ Service files use `.service.ts`. Examples: ```txt -auth.service.ts -user.service.ts -job.service.ts +src/core/services/auth.service.ts +src/core/services/cv.service.ts +src/core/services/job.service.ts ``` --- diff --git a/frontend/package.json b/frontend/package.json index bada143..3a5ea05 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -30,6 +30,7 @@ "@radix-ui/react-tooltip": "^1.1.8", "@tanstack/react-query": "^5.66.0", "@tanstack/react-query-devtools": "^5.75.7", + "agentation": "^3.0.2", "antd": "^5.24.0", "axios": "^1.7.9", "class-variance-authority": "^0.7.1", diff --git a/frontend/src/components/auth/protected-route.tsx b/frontend/src/components/auth/protected-route.tsx index cb1502b..d5e1371 100644 --- a/frontend/src/components/auth/protected-route.tsx +++ b/frontend/src/components/auth/protected-route.tsx @@ -1,19 +1,13 @@ import { type ReactNode } from 'react' -import { Navigate, Outlet, useLocation } from 'react-router-dom' - -import { ROUTE } from '@/core/constants/path' -import { useAuth } from '@/hooks/auth/use-auth' +import { Outlet } from 'react-router-dom' interface ProtectedRouteProps { children?: ReactNode redirectPath?: string } -const ProtectedRoute = ({ children, redirectPath = ROUTE.PUBLIC.LOGIN }: ProtectedRouteProps) => { - const { isAuthenticated } = useAuth() - const location = useLocation() - +const ProtectedRoute = ({ children }: ProtectedRouteProps) => { // if (!isAuthenticated) { // return // } diff --git a/frontend/src/pages/communication/chat/components/ChatHeaderNew.tsx b/frontend/src/components/chat/ChatHeader.tsx similarity index 100% rename from frontend/src/pages/communication/chat/components/ChatHeaderNew.tsx rename to frontend/src/components/chat/ChatHeader.tsx diff --git a/frontend/src/pages/communication/chat/components/ChatSidebar.tsx b/frontend/src/components/chat/ChatSidebar.tsx similarity index 95% rename from frontend/src/pages/communication/chat/components/ChatSidebar.tsx rename to frontend/src/components/chat/ChatSidebar.tsx index 2d63329..eb98154 100644 --- a/frontend/src/pages/communication/chat/components/ChatSidebar.tsx +++ b/frontend/src/components/chat/ChatSidebar.tsx @@ -1,18 +1,10 @@ -import { MessageSquare, Search } from 'lucide-react' import { useState } from 'react' +import { MessageSquare, Search } from 'lucide-react' + import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { Badge } from '@/components/ui/badge' - -export interface ConversationItem { - id: string - name: string - lastMessage: string - timestamp: string - isOnline?: boolean - avatar?: string - unreadCount?: number -} +import { type ConversationItem } from '@/models/interface/chat.interfaces' interface ChatSidebarProps { title?: string @@ -120,7 +112,8 @@ export default function ChatSidebar({