frontend changes

This commit is contained in:
Chandini 2025-09-17 12:13:30 +05:30
parent ea35b0fded
commit 906f763a78
3 changed files with 21 additions and 14 deletions

View File

@ -4,13 +4,16 @@
*/
// Main backend URL - change this to update all API calls
// export const BACKEND_URL = 'http://192.168.1.31:8000';
// LIVE PRODUCTION URL (Currently Active)
export const BACKEND_URL = 'https://backend.codenuk.com';
// LOCAL DEVELOPMENT URL (Uncomment this and comment above for local development)
// export const BACKEND_URL = 'http://localhost:8000';
// Realtime notifications socket URL (Template Manager emits notifications)
// Prefer env override if present; fallback to local Template Manager port
export const SOCKET_URL = process.env.NEXT_PUBLIC_SOCKET_URL || 'http://localhost:8009';
// Uses the same URL as BACKEND_URL for consistency
export const SOCKET_URL = BACKEND_URL;

View File

@ -3,24 +3,26 @@
* All API base URLs are managed from this single location
*/
// Default API base URL - can be overridden by environment variables
const DEFAULT_API_BASE_URL = 'http://localhost:8000';
import { BACKEND_URL } from '@/config/backend';
// Use centralized backend URL
const DEFAULT_API_BASE_URL = BACKEND_URL;
// Environment-based configuration
export const API_CONFIG = {
// Main API base URL
BASE_URL: process.env.NEXT_PUBLIC_API_URL || DEFAULT_API_BASE_URL,
BASE_URL: BACKEND_URL,
// Specific service endpoints (if needed in the future)
AUTH_SERVICE: process.env.NEXT_PUBLIC_AUTH_API_URL || DEFAULT_API_BASE_URL,
TEMPLATE_SERVICE: process.env.NEXT_PUBLIC_TEMPLATE_MANAGER_URL || DEFAULT_API_BASE_URL,
GENERATION_SERVICE: process.env.NEXT_PUBLIC_GENERATION_SERVICE_URL || DEFAULT_API_BASE_URL,
SELECTION_SERVICE: process.env.NEXT_PUBLIC_SELECTION_SERVICE_URL || DEFAULT_API_BASE_URL,
AUTH_SERVICE: BACKEND_URL,
TEMPLATE_SERVICE: BACKEND_URL,
GENERATION_SERVICE: BACKEND_URL,
SELECTION_SERVICE: BACKEND_URL,
// AI Mockup Wireframe Service via API Gateway
// Route through gateway on port 8000 to unify CORS/auth and service access
AI_MOCKUP_SERVICE: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000/api/mockup',
USER_AUTH_SERVICE: process.env.NEXT_PUBLIC_AUTH_URL || 'http://localhost:8000/api/auth',
AI_MOCKUP_SERVICE: `${BACKEND_URL}/api/mockup`,
USER_AUTH_SERVICE: `${BACKEND_URL}/api/auth`,
} as const;
// AI Mockup Configuration

View File

@ -1,8 +1,10 @@
// Configuration for the wireframe generator
import { BACKEND_URL } from '@/config/backend';
export const config = {
// Backend API configuration
backend: {
baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000',
baseUrl: BACKEND_URL,
endpoints: {
health: '/health',
generateWireframe: '/generate-wireframe',
@ -18,7 +20,7 @@ export const config = {
// User Authentication Service
auth: {
baseUrl: process.env.NEXT_PUBLIC_AUTH_URL || 'http://localhost:8000',
baseUrl: BACKEND_URL,
endpoints: {
health: '/health',
register: '/api/auth/register',