feat: add PostgreSQL database support and development scripts

- Added pg and @types/pg dependencies for PostgreSQL integration
- Created database testing and backend initialization scripts
- Changed dev server port to 3002 to avoid conflicts
This commit is contained in:
Yusuf İpek
2025-11-10 18:02:08 +03:00
parent e82366e5e8
commit 596bba0832
17 changed files with 1518 additions and 3 deletions
+86
View File
@@ -0,0 +1,86 @@
export interface Package {
id: string
name: string
description?: string
version?: string
platform_id: string
category_id?: number
license_id?: number
type?: 'gui' | 'cli'
repository?: 'official' | 'third-party'
homepage_url?: string
download_url?: string
last_updated?: Date
downloads_count?: number
popularity_score?: number
is_active: boolean
created_at: Date
updated_at: Date
// Joined fields
platform?: Platform
category?: Category
license?: License
tags?: string[]
dependencies?: Package[]
}
export interface Platform {
id: string
name: string
package_manager: string
icon?: string
}
export interface Category {
id: number
name: string
description?: string
}
export interface License {
id: number
name: string
url?: string
}
export interface CreatePackageInput {
id: string
name: string
description?: string
version?: string
platform_id: string
category_id?: number
license_id?: number
type?: 'gui' | 'cli'
repository?: 'official' | 'third-party'
homepage_url?: string
download_url?: string
popularity_score?: number
}
export interface UpdatePackageInput {
name?: string
description?: string
version?: string
category_id?: number
license_id?: number
type?: 'gui' | 'cli'
repository?: 'official' | 'third-party'
homepage_url?: string
download_url?: string
popularity_score?: number
is_active?: boolean
}
export interface PackageFilter {
platform_id?: string
category_id?: number
type?: 'gui' | 'cli'
repository?: 'official' | 'third-party'
search?: string
limit?: number
offset?: number
sort_by?: 'name' | 'popularity_score' | 'last_updated' | 'downloads_count'
sort_order?: 'asc' | 'desc'
}
+21
View File
@@ -0,0 +1,21 @@
export interface Platform {
id: string
name: string
package_manager: string
icon?: string
created_at: Date
updated_at: Date
}
export interface CreatePlatformInput {
id: string
name: string
package_manager: string
icon?: string
}
export interface UpdatePlatformInput {
name?: string
package_manager?: string
icon?: string
}