feat: sase.tr v2 full application implementation
Complete rewrite of sase.tr VIN lookup platform with modern stack: Backend (NestJS 10 + Drizzle ORM + PostgreSQL + Redis + BullMQ): - 34 DB models (core + PL24 + EMEX schemas) - Auth via Better Auth (email/password + social) - Brands, Plans, Subscriptions, Payments (iyzico + EFT) - VIN decode orchestration (Corgi + PL24 + EMEX + NHTSA) - Interactive schema viewer backend (MinIO storage) - EMEX scraping integration (Puppeteer + BullMQ workers) - Translation module (EN→TR automotive dictionary) - Admin dashboard API (stats, user mgmt, payment approval) - Rate limiting, Helmet security, file upload validation Frontend (Next.js 15 + Tailwind v4 + shadcn/ui + TanStack Query + Zustand): - 20 routes: auth, dashboard, VIN search, schema viewer, admin - Interactive schema viewer with zoom/pan/hotspot highlighting - Subscription management with brand selector - Payment flow (iyzico 3D Secure + EFT with receipt upload) - i18n support (TR/EN) - Error boundaries, loading skeletons, 404 page Infrastructure: - 85 tests (52 backend + 33 frontend, Vitest) - CI/CD (GitHub Actions: lint, typecheck, test, build, deploy) - Zero-downtime deploy script (PM2) - Env validation script Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
39
packages/shared/src/constants/error-codes.ts
Normal file
39
packages/shared/src/constants/error-codes.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
export const ERROR_CODES = {
|
||||
// Auth
|
||||
INVALID_CREDENTIALS: "AUTH_001",
|
||||
EMAIL_ALREADY_EXISTS: "AUTH_002",
|
||||
SESSION_EXPIRED: "AUTH_003",
|
||||
UNAUTHORIZED: "AUTH_004",
|
||||
FORBIDDEN: "AUTH_005",
|
||||
|
||||
// VIN
|
||||
INVALID_VIN: "VIN_001",
|
||||
VIN_DECODE_FAILED: "VIN_002",
|
||||
BRAND_NOT_SUPPORTED: "VIN_003",
|
||||
|
||||
// Subscription
|
||||
NO_ACTIVE_SUBSCRIPTION: "SUB_001",
|
||||
BRAND_ACCESS_DENIED: "SUB_002",
|
||||
INVALID_BRAND_COUNT: "SUB_003",
|
||||
SUBSCRIPTION_ALREADY_ACTIVE: "SUB_004",
|
||||
|
||||
// Payment
|
||||
PAYMENT_FAILED: "PAY_001",
|
||||
IYZICO_ERROR: "PAY_002",
|
||||
EFT_RECEIPT_REQUIRED: "PAY_003",
|
||||
PAYMENT_ALREADY_PROCESSED: "PAY_004",
|
||||
|
||||
// General
|
||||
NOT_FOUND: "GEN_001",
|
||||
VALIDATION_ERROR: "GEN_002",
|
||||
INTERNAL_ERROR: "GEN_003",
|
||||
RATE_LIMITED: "GEN_004",
|
||||
CONFLICT: "GEN_005",
|
||||
|
||||
// Integration
|
||||
PL24_ERROR: "INT_001",
|
||||
EMEX_ERROR: "INT_002",
|
||||
CORGI_ERROR: "INT_003",
|
||||
} as const;
|
||||
|
||||
export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
|
||||
33
packages/shared/src/constants/plans.ts
Normal file
33
packages/shared/src/constants/plans.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
export const PLANS = {
|
||||
SINGLE: {
|
||||
name: "1 Marka",
|
||||
brandCount: 1,
|
||||
priceMonthly: 200_00,
|
||||
priceYearly: 2000_00,
|
||||
},
|
||||
DOUBLE: {
|
||||
name: "2 Marka",
|
||||
brandCount: 2,
|
||||
priceMonthly: 350_00,
|
||||
priceYearly: 3500_00,
|
||||
},
|
||||
TRIPLE: {
|
||||
name: "3 Marka",
|
||||
brandCount: 3,
|
||||
priceMonthly: 500_00,
|
||||
priceYearly: 5000_00,
|
||||
},
|
||||
FULL: {
|
||||
name: "Full Paket",
|
||||
brandCount: 0,
|
||||
priceMonthly: 999_00,
|
||||
priceYearly: 9990_00,
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const REFERRAL_REWARDS = {
|
||||
TIER_1: { count: 3, extensionDays: 7 },
|
||||
TIER_2: { count: 5, extensionDays: 30 },
|
||||
} as const;
|
||||
|
||||
export const CURRENCY = "TRY" as const;
|
||||
5
packages/shared/src/constants/regex.ts
Normal file
5
packages/shared/src/constants/regex.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const VIN_REGEX = /^[A-HJ-NPR-Z0-9]{17}$/;
|
||||
|
||||
export const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
|
||||
export const OEM_CODE_REGEX = /^[A-Z0-9\-.\s]{3,30}$/i;
|
||||
Reference in New Issue
Block a user