Ugrás a fő tartalomhoz

Deployment

Build

npm install
npx next build

Environment

CakeMarket is configured for deployment on Cloudflare (see wrangler.toml and open-next.config.ts).

Key Configuration Files

FilePurpose
next.config.tsImage optimisation, security headers, caching
wrangler.tomlCloudflare Workers config
open-next.config.tsOpenNext adapter for Cloudflare
drizzle.config.tsDatabase migration config

Security Headers

Configured in next.config.ts:

  • Content-Security-Policy (CSP)
  • Strict-Transport-Security (HSTS)
  • X-Frame-Options
  • X-Content-Type-Options
  • Referrer-Policy

CORS

Handled in src/middleware.ts for API routes.

PWA Support

The app is a Progressive Web App with:

  • public/manifest.json — App manifest
  • public/sw.js — Service worker (caches static assets, offline fallback)
  • public/offline.html — Offline page
  • PWA icons in public/icons/
  • Service worker registration in src/app/layout.tsx

Cron Jobs

Set up an external scheduler to call these endpoints periodically:

POST /api/requests/expire # Every 5 minutes
POST /api/offers/expire-holds # Every 5 minutes
POST /api/orders/start-work # Hourly — auto-start work 3 days before the due date
POST /api/orders/escrow-release # Every 15 minutes

Email

  • Production: Resend API
  • Development: Console logging

Configure the Resend API key in your environment variables.