Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ export class ChatbotStack extends cdk.Stack {
`if aws secretsmanager get-secret-value --secret-id "${projectName}/mcp/google-maps-credentials" --region ${this.region} &>/dev/null; then [ -n "$DEFAULT_KEYS" ] && DEFAULT_KEYS="$DEFAULT_KEYS,"; DEFAULT_KEYS="\${DEFAULT_KEYS}google_maps_api_key"; echo " ✓ Google Maps"; fi`,
`if aws secretsmanager get-secret-value --secret-id "${projectName}/nova-act-api-key" --region ${this.region} &>/dev/null; then [ -n "$DEFAULT_KEYS" ] && DEFAULT_KEYS="$DEFAULT_KEYS,"; DEFAULT_KEYS="\${DEFAULT_KEYS}nova_act_api_key"; echo " ✓ Nova Act"; fi`,
'echo "Default API keys: $DEFAULT_KEYS"',
`BUILD_DATETIME=$(date -u +%Y%m%d%H%M%S)`,
`APP_VERSION="${process.env.NEXT_PUBLIC_APP_VERSION || '0.0.0'}-$BUILD_DATETIME"`,
'echo "App Version: $APP_VERSION"',
],
},
build: {
Expand Down
3 changes: 3 additions & 0 deletions chatbot-app/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ARG NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID
ARG NEXT_PUBLIC_STREAMING_API_URL
ARG NEXT_PUBLIC_GOOGLE_MAPS_EMBED_API_KEY
ARG NEXT_PUBLIC_DEFAULT_KEYS
ARG NEXT_PUBLIC_APP_VERSION
ARG CORS_ORIGINS

# Set environment variables for build
Expand All @@ -29,6 +30,7 @@ ENV NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID=$NEXT_PUBLIC_COGNITO_USER_POOL_CLIEN
ENV NEXT_PUBLIC_STREAMING_API_URL=$NEXT_PUBLIC_STREAMING_API_URL
ENV NEXT_PUBLIC_GOOGLE_MAPS_EMBED_API_KEY=$NEXT_PUBLIC_GOOGLE_MAPS_EMBED_API_KEY
ENV NEXT_PUBLIC_DEFAULT_KEYS=$NEXT_PUBLIC_DEFAULT_KEYS
ENV NEXT_PUBLIC_APP_VERSION=$NEXT_PUBLIC_APP_VERSION
ENV CORS_ORIGINS=$CORS_ORIGINS

COPY --from=deps /app/node_modules ./node_modules
Expand All @@ -42,6 +44,7 @@ RUN echo "NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID=$NEXT_PUBLIC_COGNITO_USER_POOL
RUN echo "NEXT_PUBLIC_STREAMING_API_URL=$NEXT_PUBLIC_STREAMING_API_URL"
RUN echo "NEXT_PUBLIC_GOOGLE_MAPS_EMBED_API_KEY=${NEXT_PUBLIC_GOOGLE_MAPS_EMBED_API_KEY:0:10}..." # Only show first 10 chars for security
RUN echo "NEXT_PUBLIC_DEFAULT_KEYS=$NEXT_PUBLIC_DEFAULT_KEYS"
RUN echo "NEXT_PUBLIC_APP_VERSION=$NEXT_PUBLIC_APP_VERSION"
RUN echo "CORS_ORIGINS=$CORS_ORIGINS"

RUN npm run build
Expand Down
4 changes: 3 additions & 1 deletion chatbot-app/frontend/src/app/api/health/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
*/
import { NextResponse } from 'next/server'

const VERSION = process.env.NEXT_PUBLIC_APP_VERSION || '1.0.0';

export async function GET() {
return NextResponse.json({
status: 'healthy',
service: 'bff',
version: '2.0.0'
version: VERSION
})
}
8 changes: 7 additions & 1 deletion chatbot-app/frontend/src/app/health/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { NextResponse } from 'next/server';

import { ENV_CONFIG } from '../../config/environment';

export async function GET() {
return NextResponse.json({ status: 'healthy', timestamp: new Date().toISOString() });
return NextResponse.json({
status: 'healthy',
timestamp: new Date().toISOString(),
appversion: ENV_CONFIG.APP_VERSION
});
}
2 changes: 2 additions & 0 deletions chatbot-app/frontend/src/config/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const ENV_CONFIG = {
API_BASE_URL: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000',
FRONTEND_URL: process.env.NEXT_PUBLIC_FRONTEND_URL || 'http://localhost:3000',

APP_VERSION: process.env.NEXT_PUBLIC_APP_VERSION || '0.0.0',

// Streaming API Configuration (bypasses CloudFront 60s timeout)
// This should point to ALB directly for long-running streaming requests
STREAMING_API_URL: process.env.NEXT_PUBLIC_STREAMING_API_URL || process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000',
Expand Down