diff --git a/Dockerfile b/Dockerfile index b158351..1178498 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,8 @@ ENV NEXT_PUBLIC_SUPABASE_URL=https://placeholder.supabase.co ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=placeholder-anon-key ENV SUPABASE_SERVICE_ROLE_KEY=placeholder-service-role-key ENV STRIPE_SECRET_KEY=placeholder +ENV RESEND_API_KEY="" +ENV GOOGLE_SERVICE_ACCOUNT_JSON="" ENV NODE_OPTIONS="--max-old-space-size=16384" ENV NEXT_ESLINT_IGNORE_DURING_BUILDS=true ENV NEXT_PRIVATE_WORKERS=1 diff --git a/Dockerfile.coolify b/Dockerfile.coolify new file mode 100644 index 0000000..3591abc --- /dev/null +++ b/Dockerfile.coolify @@ -0,0 +1,36 @@ +# Dockerfile simplificado para Coolify +FROM node:20-alpine + +WORKDIR /app + +# Instalar dependencias +COPY package.json package-lock.json ./ +RUN npm ci --ignore-scripts + +# Copiar cรณdigo fuente +COPY . . + +# Variables de entorno +ENV NEXT_TELEMETRY_DISABLED=1 +ENV NODE_ENV=production +ENV NEXT_PUBLIC_SUPABASE_URL=https://placeholder.supabase.co +ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=placeholder-anon-key + +# Aumentar memoria para build +ENV NODE_OPTIONS="--max-old-space-size=4096" + +# Build +RUN npm run build + +# Configurar usuario +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + +USER nextjs + +EXPOSE 3000 + +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" + +CMD ["npm", "start"] diff --git a/app/api/receipts/[bookingId]/email/route.ts b/app/api/receipts/[bookingId]/email/route.ts index f588e32..10d0549 100644 --- a/app/api/receipts/[bookingId]/email/route.ts +++ b/app/api/receipts/[bookingId]/email/route.ts @@ -5,7 +5,13 @@ import { format } from 'date-fns' import { es } from 'date-fns/locale' import { Resend } from 'resend' -const resend = new Resend(process.env.RESEND_API_KEY!) +function getResendClient() { + const apiKey = process.env.RESEND_API_KEY + if (!apiKey || apiKey === 'placeholder' || apiKey === '') { + return null + } + return new Resend(apiKey) +} /** @description Send receipt email for booking */ export async function POST( @@ -105,6 +111,12 @@ export async function POST( ` + const resend = getResendClient() + if (!resend) { + console.error('RESEND_API_KEY not configured') + return NextResponse.json({ error: 'Email service not configured' }, { status: 500 }) + } + const { data: emailResult, error: emailError } = await resend.emails.send({ from: 'ANCHOR:23 ', to: booking.customer.email, diff --git a/app/index/testlinks/page.tsx b/app/index/testlinks/page.tsx deleted file mode 100644 index 724bb14..0000000 --- a/app/index/testlinks/page.tsx +++ /dev/null @@ -1,156 +0,0 @@ -import Link from 'next/link' - -/** - * @description Testing page with links to all domains and API endpoints - * @audit DEBUG: Internal testing page for route validation - */ -export default function TestLinksPage() { - return ( -
-
-

๐Ÿš€ AnchorOS Test Links

-

- Testing page for all AnchorOS domains and API endpoints. Click any link to navigate or test. -

- - {/* anchor23.mx - Frontend Institucional */} -
-

๐ŸŒ anchor23.mx - Frontend Institucional

-
- ๐Ÿ  Landing Page (/) - ๐Ÿ’… Servicios (/servicios) - ๐Ÿ“– Historia (/historia) - ๐Ÿ“ง Contacto (/contacto) - ๐Ÿข Franquicias (/franquicias) - ๐Ÿ‘‘ Membresรญas (/membresias) - ๐Ÿ”’ Privacy Policy - โš–๏ธ Legal -
-
- - {/* booking.anchor23.mx - Frontend de Reservas */} -
-

๐Ÿ“… booking.anchor23.mx - Frontend de Reservas

-
- ๐Ÿ’… Selecciรณn de Servicios (/booking/servicios) - ๐Ÿ“ Flujo de Reserva (/booking/cita) - ๐Ÿ‘ค Registro de Cliente (/booking/registro) - ๐Ÿ” Login (/booking/login) - ๐Ÿ‘ค Perfil (/booking/perfil) - ๐Ÿ“… Mis Citas (/booking/mis-citas) - โœ… Confirmaciรณn (/booking/confirmacion) -
-
- - {/* aperture.anchor23.mx - Backend Administrativo */} -
-

โš™๏ธ aperture.anchor23.mx - Backend Administrativo

-
- ๐Ÿ“Š Dashboard Home (/aperture) - ๐Ÿ“… Calendario Maestro (/aperture/calendar) - ๐Ÿ‘ฅ Gestiรณn de Staff (/aperture/staff) - ๐Ÿ’ฐ Nรณmina (/aperture/staff/payroll) - ๐Ÿ‘ฅ Clientes (/aperture/clients) - ๐ŸŽ Fidelizaciรณn (/aperture/loyalty) - ๐Ÿ›’ POS (/aperture/pos) - ๐Ÿ’ธ Finanzas (/aperture/finance) - ๐Ÿ” Login Admin (/aperture/login) -
-
- - {/* kiosk.anchor23.mx - Sistema de Kiosko */} -
-

๐Ÿ–ฅ๏ธ kiosk.anchor23.mx - Sistema de Kiosko

-
-
๐Ÿ”„ Kiosk system requires physical device with API key
-
๐Ÿ“ฑ Touchscreen interface for walk-ins and confirmations
-
-
- - {/* API Endpoints */} -
-

๐Ÿ”Œ API Endpoints - api.anchor23.mx

-
- {/* Public APIs */} -
๐ŸŒ Public APIs:
-
-
- GET /api/services - GET /api/locations - GET /api/public/availability - POST /api/customers - POST /api/bookings -
-
- - {/* Aperture APIs */} -
โš™๏ธ Aperture APIs:
-
-
- GET /api/aperture/dashboard - GET /api/aperture/calendar - GET /api/aperture/staff - GET /api/aperture/resources - POST /api/aperture/bookings/[id]/reschedule - GET /api/aperture/payroll - GET /api/aperture/pos - GET /api/aperture/finance -
-
- - {/* Kiosk APIs */} -
๐Ÿ–ฅ๏ธ Kiosk APIs:
-
-
- POST /api/kiosk/walkin - GET/POST /api/kiosk/bookings - POST /api/kiosk/bookings/[shortId]/confirm - POST /api/kiosk/authenticate - GET /api/kiosk/resources/available -
-
- - {/* Sync APIs (New in FASE 2) */} -
๐Ÿ”„ Sync APIs (FASE 2):
-
-
- GET /api/sync/calendar/test - POST /api/sync/calendar/bookings - POST /api/sync/calendar - POST /api/sync/calendar/webhook -
-
- - {/* Admin APIs */} -
๐Ÿ”ง Admin APIs:
-
-
- GET /api/admin/locations - GET /api/admin/kiosks - GET /api/admin/users - GET /api/availability/blocks - GET /api/availability/staff-unavailable -
-
-
-
- - {/* Environment Info */} -
-

โ„น๏ธ Environment Info

-
-

Frontend: {process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:2311'}

-

API: {process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:2311'}/api

-

Status: FASE 2 Complete - Google Calendar, Dual Artists, Enhanced Availability

-
-
- - {/* Footer */} -
-

AnchorOS Test Links - Internal Development Tool

-

Last updated: Sprint 2 Completion

-
-
-
- ) -} \ No newline at end of file