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:
ersaayan
2025-11-22 16:20:36 +03:00
parent afd4456893
commit 73f9248e98
12 changed files with 2169 additions and 8 deletions
+9
View File
@@ -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()