app: the Church App's foundation; docs for Hub 2.26.1 and two years of devotionals
apps/app (not released; app@1.0.0 is built in slices, APP-1.0-PLAN §15): - backend (Express, Prisma, pg-boss, as the Website): the Hub client (CCP-, product app, the active-member band in the heartbeat), links and church.changed, sign-in through Accounts (everyone a Member; 8 days renewed up to 90; every role only with 2FA; the first Owner from HUB_ADMIN_EMAIL), Accounts' user.updated/export/deleted, active members once a day, modules on and off, GET /api/v1/app. Migration init. - frontend (Next.js 16): header, tab bar, footer, manifest and icons from the church profile, service worker, Add to home screen, Me, the admin's first dashboard. - env.template.json, PM2 template, README, CHANGELOG, WHATS-NEW; 27 tests. Docs: the Hub runs 2.26.1 with two years of Cross Code's devotionals; an App gets 2 weeks, today included. HANDOVER lists the App's slices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
// Everything under /api is the backend (docs/APP-1.0-PLAN.md §1). On a server nginx sends it
|
||||
// there; in development (and when Next is reached directly) this rewrite does.
|
||||
const api = (process.env.APP_API_URL || "http://127.0.0.1:5400").replace(/\/+$/, "");
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
poweredByHeader: false,
|
||||
transpilePackages: ["@crosscode/ui"],
|
||||
async rewrites() {
|
||||
return [{ source: "/api/:path*", destination: `${api}/api/:path*` }];
|
||||
},
|
||||
async headers() {
|
||||
// Public content is indexed (ROADMAP-v3 §11); the member's own pages, the admin and every
|
||||
// prayer page never are (APP-1.0-PLAN §4, §11).
|
||||
const common = [
|
||||
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
|
||||
{ key: "X-Content-Type-Options", value: "nosniff" },
|
||||
];
|
||||
const noindex = { key: "X-Robots-Tag", value: "noindex, nofollow" };
|
||||
const never = ["/admin", "/admin/:path*", "/me", "/me/:path*", "/prayer", "/prayer/:path*", "/auth/:path*", "/offline"];
|
||||
return [
|
||||
{ source: "/:path*", headers: common },
|
||||
...never.map((source) => ({ source, headers: [noindex] })),
|
||||
// The service worker is checked for updates on every visit (§2).
|
||||
{ source: "/sw.js", headers: [{ key: "Cache-Control", value: "no-cache" }, { key: "Service-Worker-Allowed", value: "/" }] },
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
Reference in New Issue
Block a user