mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 14:26:37 -06:00
Complete architectural overhaul migrating from Directus+tRPC to Payload CMS with Next.js App Router. This represents a fundamental shift in how the application is structured and how data is managed. Major changes: - Migrated from Pages Router (src/pages/) to App Router (src/app/) - Replaced Directus CMS with Payload CMS as the content management system - Removed tRPC in favor of Payload's built-in API routes - Added PostgreSQL database via Docker Compose for local development - Implemented separate route groups for frontend and Payload admin - Updated all API routes to App Router conventions - Added Payload collections for Projects, Technologies, Links, Media, and Users - Configured ESLint for new project structure Infrastructure: - Added docker-compose.yml for PostgreSQL database - Updated environment variables for Payload CMS configuration - Integrated @payloadcms/next for seamless Next.js integration - Added GraphQL API and playground routes Dependencies: - Upgraded React from 18.2.0 to 19.2.0 - Upgraded Next.js to 15.5.6 - Added Payload CMS 3.x packages (@payloadcms/db-postgres, @payloadcms/next, etc.) - Removed Directus SDK and tRPC packages - Updated Sharp to 0.34.x - Migrated to @tanstack/react-query v5
37 lines
943 B
TypeScript
37 lines
943 B
TypeScript
import { getPayload } from "payload";
|
|
import config from "../../../payload.config";
|
|
import { redirect } from "next/navigation";
|
|
|
|
export const dynamic = "force-dynamic"; // Don't prerender at build time
|
|
|
|
type Metadata = {
|
|
tagline: string;
|
|
resume: {
|
|
id: string;
|
|
url: string;
|
|
filename: string;
|
|
};
|
|
resumeFilename?: string;
|
|
};
|
|
|
|
export default async function ResumePage() {
|
|
try {
|
|
const payloadConfig = await config;
|
|
const payload = await getPayload({ config: payloadConfig });
|
|
|
|
// @ts-ignore - Globals will be typed after first database connection
|
|
const metadata = (await payload.findGlobal({
|
|
slug: "metadata",
|
|
})) as Metadata;
|
|
|
|
if (!metadata.resume?.url) {
|
|
throw new Error("Resume URL not found");
|
|
}
|
|
|
|
redirect(metadata.resume.url);
|
|
} catch (error) {
|
|
console.error("Failed to acquire resume asset URL", error);
|
|
throw new Error(`Failed to acquire resume (${error})`);
|
|
}
|
|
}
|