42d4cb896a
Public cafe discovery app:
- SEO-optimised pages: home, /cafe/[slug], /search, /city/[city]
- AI search bar with natural language queries
- Structured data (JSON-LD) for Google rich results
- City browsing, rating/filter sidebar, similar cafes
- Review listing, full menu preview, working-hours card
- Web App Manifest + offline fallback page (PWA)
- Next.js 16: params/searchParams typed as Promise<{}>
- Fix Lucide icon title→aria-label (type removed upstream)
- "use client" on offline page (onClick handler)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import type { NextConfig } from "next";
|
|
import createNextIntlPlugin from "next-intl/plugin";
|
|
import withPWAInit from "@ducanh2912/next-pwa";
|
|
|
|
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
|
|
|
|
const withPWA = withPWAInit({
|
|
dest: "public",
|
|
cacheOnFrontEndNav: true,
|
|
aggressiveFrontEndNavCaching: true,
|
|
reloadOnOnline: true,
|
|
disable: process.env.NODE_ENV === "development",
|
|
workboxOptions: {
|
|
disableDevLogs: true,
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /\/cafe\//,
|
|
handler: "StaleWhileRevalidate",
|
|
options: {
|
|
cacheName: "cafe-pages",
|
|
expiration: { maxEntries: 100, maxAgeSeconds: 7 * 24 * 60 * 60 },
|
|
},
|
|
},
|
|
{
|
|
urlPattern: /\/api\/public\//,
|
|
handler: "NetworkFirst",
|
|
options: {
|
|
cacheName: "api-cache",
|
|
networkTimeoutSeconds: 5,
|
|
expiration: { maxEntries: 200, maxAgeSeconds: 5 * 60 },
|
|
},
|
|
},
|
|
{
|
|
urlPattern: /\.(?:png|jpg|jpeg|svg|gif|webp|ico)$/,
|
|
handler: "CacheFirst",
|
|
options: {
|
|
cacheName: "image-cache",
|
|
expiration: { maxEntries: 200, maxAgeSeconds: 30 * 24 * 60 * 60 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
images: {
|
|
remotePatterns: [
|
|
{ protocol: "https", hostname: "**" },
|
|
{ protocol: "http", hostname: "**" },
|
|
],
|
|
},
|
|
};
|
|
|
|
export default withPWA(withNextIntl(nextConfig));
|