forked from cardosofelipe/fast-next-template
Add foundational API client, UI components, and state management setup
- Created `generate-api-client.sh` for OpenAPI-based TypeScript client generation. - Added `src/lib/api` with Axios-based API client, error handling utilities, and placeholder for generated types. - Implemented Zustand-based `authStore` for user authentication and token management. - Integrated reusable UI components (e.g., `Dialog`, `Select`, `Textarea`, `Sheet`, `Separator`, `Checkbox`) using Radix UI and utility functions. - Established groundwork for client-server integration, state management, and modular UI development.
This commit is contained in:
27
frontend/src/config/index.ts
Executable file
27
frontend/src/config/index.ts
Executable file
@@ -0,0 +1,27 @@
|
||||
// Application configuration
|
||||
// Environment variables, constants, feature flags, etc.
|
||||
|
||||
export const config = {
|
||||
api: {
|
||||
baseUrl: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000/api/v1',
|
||||
timeout: parseInt(process.env.NEXT_PUBLIC_API_TIMEOUT || '30000', 10),
|
||||
},
|
||||
app: {
|
||||
name: process.env.NEXT_PUBLIC_APP_NAME || 'Template Project',
|
||||
url: process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000',
|
||||
},
|
||||
auth: {
|
||||
tokenRefreshThreshold: parseInt(process.env.NEXT_PUBLIC_TOKEN_REFRESH_THRESHOLD || '300000', 10),
|
||||
accessTokenExpiry: parseInt(process.env.NEXT_PUBLIC_ACCESS_TOKEN_EXPIRY || '900000', 10),
|
||||
refreshTokenExpiry: parseInt(process.env.NEXT_PUBLIC_REFRESH_TOKEN_EXPIRY || '604800000', 10),
|
||||
},
|
||||
features: {
|
||||
enableRegistration: process.env.NEXT_PUBLIC_ENABLE_REGISTRATION === 'true',
|
||||
enableSessionManagement: process.env.NEXT_PUBLIC_ENABLE_SESSION_MANAGEMENT === 'true',
|
||||
},
|
||||
debug: {
|
||||
api: process.env.NEXT_PUBLIC_DEBUG_API === 'true',
|
||||
},
|
||||
} as const;
|
||||
|
||||
export type AppConfig = typeof config;
|
||||
Reference in New Issue
Block a user