mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
- Remove nested git repository from bugulma/frontend/.git - Add all frontend files to main repository tracking - Convert from separate frontend/backend repos to unified monorepo - Preserve all frontend code and development history as tracked files - Eliminate nested repository complexity for simpler development workflow This creates a proper monorepo structure with frontend and backend coexisting in the same repository for easier development and deployment.
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
/**
|
|
* Service Configuration Utilities
|
|
* Provides reusable configuration patterns for all API services
|
|
*/
|
|
|
|
import { API_ENDPOINTS } from '@/lib/api-config';
|
|
|
|
/**
|
|
* Default service configuration
|
|
* Provides consistent settings across all services
|
|
*/
|
|
export const createServiceConfig = (endpoint: string) => ({
|
|
basePath: endpoint,
|
|
enableLogging: import.meta.env.DEV,
|
|
});
|
|
|
|
/**
|
|
* Pre-configured service configs for common endpoints
|
|
* Eliminates repetitive constructor code
|
|
*/
|
|
export const SERVICE_CONFIGS = {
|
|
ORGANIZATIONS: createServiceConfig(API_ENDPOINTS.ORGANIZATIONS),
|
|
SITES: createServiceConfig(API_ENDPOINTS.SITES),
|
|
MATCHING: createServiceConfig(API_ENDPOINTS.MATCHING),
|
|
ANALYTICS: createServiceConfig(API_ENDPOINTS.ANALYTICS),
|
|
HERITAGE: createServiceConfig(API_ENDPOINTS.HERITAGE),
|
|
AI: createServiceConfig(API_ENDPOINTS.AI),
|
|
PROPOSALS: createServiceConfig(API_ENDPOINTS.PROPOSALS),
|
|
} as const;
|
|
|
|
/**
|
|
* Type-safe service config getter
|
|
*/
|
|
export const getServiceConfig = (endpoint: keyof typeof SERVICE_CONFIGS) => SERVICE_CONFIGS[endpoint];
|
|
|
|
/**
|
|
* Common service options interface
|
|
*/
|
|
export interface ServiceOptions {
|
|
basePath: string;
|
|
enableLogging?: boolean;
|
|
defaultTimeout?: number;
|
|
retries?: number;
|
|
}
|