Skip to content

API Migration Status

Migrated API Endpoints

We have successfully migrated the following API endpoints from Next.js API routes to Firebase Cloud Functions:

StatusNext.js API RouteFirebase Function Endpoint
/api/auth-status/api/auth-status
/api/send-email/api/send-email
/api/export-data/api/export-data
/api/health/api/health
/api/verify-token/api/verify-token
/api/auth/refresh-token/api/auth/refresh-token
/api/users/api/users
/api/users/reset-password/api/users/reset-password

Updated Client Components

We have updated the following client components to use the new API endpoints:

StatusComponent/ServiceNotes
src/lib/notifications/emailService.tsUpdated to use the new API configuration
src/components/export/DataExport.tsxUpdated to use the new API with authentication
src/lib/firebase/userClientService.tsUpdated all user management functions to use new API endpoints
src/lib/auth/AuthContext.tsxUpdated token refresh functionality
Convert server components to client componentsRemaining components still need to be updated

Next Steps

  1. Deploy Firebase Functions:

    Terminal window
    firebase deploy --only functions
  2. Update Next.js Configuration:

    • To enable static export mode, update next.config.js:
    output: 'export',
    images: {
    unoptimized: true,
    }
  3. Update Dynamic Routes:

    • Either implement generateStaticParams() for dynamic routes like /tickets/[id]
    • Or convert them to use client-side data fetching
  4. Build and Deploy Static Site:

    Terminal window
    npm run build
    firebase deploy --only hosting

Remaining Work

  1. Convert server components to client components
  2. Handle dynamic routes
  3. Configure and test static export
  4. Handle client-side authentication flow
  5. Update middleware.ts for static site compatibility
  6. Test API functionality and authentication