mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 18:46:07 +00:00
feat: Add smart package recommendations feature
- Implement onboarding modal with 3-step wizard - Category selection (up to 3 categories) - OS detection with manual override - Experience level selection - Add intelligent recommendation engine - Hybrid scoring algorithm (category 40%, popularity 30%, OS 20%, preset 10%) - 7 curated categories with preset packages - Support for all platforms (Windows, macOS, Ubuntu, Debian, Arch, Fedora) - Create recommendation UI components - RecommendationsSection with grid layout - Package cards with recommendation scores and reasons - User profile display with customization options - Add localStorage-based profile management - Persistent user preferences - Automatic OS detection - Profile CRUD operations via useRecommendationProfile hook - Implement API endpoint - POST /api/recommendations - GET /api/recommendations (query params) - Request validation and error handling - Add full i18n support - English and Turkish translations - Onboarding flow, categories, and UI labels - Update TypeScript config (lib: es2017 for array.includes) Closes #1
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Platform, Package, FilterOptions } from '@/types'
|
||||
import { RecommendationRequest, RecommendationResponse } from '@/types/recommendations'
|
||||
|
||||
const API_BASE_URL = (process.env.NEXT_PUBLIC_API_URL && process.env.NEXT_PUBLIC_API_URL.trim() !== '')
|
||||
? process.env.NEXT_PUBLIC_API_URL.replace(/\/$/, '')
|
||||
@@ -87,6 +88,14 @@ class ApiClient {
|
||||
async getSyncStatus(): Promise<{ status: string, last_sync: string | null, platforms: string[] }> {
|
||||
return this.request<{ status: string, last_sync: string | null, platforms: string[] }>('/sync')
|
||||
}
|
||||
|
||||
// Recommendation operations
|
||||
async getRecommendations(request: RecommendationRequest): Promise<RecommendationResponse> {
|
||||
return this.request<RecommendationResponse>('/recommendations', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const apiClient = new ApiClient()
|
||||
|
||||
Reference in New Issue
Block a user