refactor: migrate to pnpm monorepo with Payload CMS backend and Astro frontend to support scalable website development and AI-assisted workflows

This commit is contained in:
2025-09-25 03:36:26 +08:00
parent 4efabd168c
commit 74677acf77
243 changed files with 28435 additions and 102 deletions

View File

@@ -0,0 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1758741038303
}
}

1
apps/frontend/.astro/types.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="astro/client" />

3
apps/frontend/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Frontend (Astro)
This package hosts the Astro application for enchun.tw. Use `pnpm dev` to run the site locally once dependencies are installed at the workspace root.

View File

@@ -0,0 +1,12 @@
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
import tailwind from '@astrojs/tailwind';
export default defineConfig({
output: 'server',
adapter: cloudflare(),
integrations: [tailwind()],
typescript: {
strict: true
}
});

View File

@@ -0,0 +1,23 @@
{
"name": "@enchun/frontend",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"check": "astro check"
},
"dependencies": {
"@astrojs/cloudflare": "^9.0.0",
"@astrojs/tailwind": "^5.0.0",
"astro": "^4.0.0",
"better-auth": "^1.3.13"
},
"devDependencies": {
"autoprefixer": "^10.4.0",
"tailwindcss": "^3.4.0",
"typescript": "^5.4.0"
}
}

View File

@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};

2
apps/frontend/src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

View File

@@ -0,0 +1,16 @@
---
import '../styles/tailwind.css';
---
<html lang="en">
<head>
<meta charset="utf-8" />
<title>enchun.tw</title>
</head>
<body class="bg-surface text-text">
<main class="mx-auto flex min-h-screen max-w-4xl flex-col items-center justify-center gap-6 px-4 text-center">
<h1 class="text-4xl font-semibold text-primary">enchun.tw migration scaffold</h1>
<p class="text-lg text-secondary">Astro SSR frontend is ready for development.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@@ -0,0 +1,9 @@
const sharedConfig = require('@enchun/shared/tailwind-config');
module.exports = {
...sharedConfig,
content: [
'./src/**/*.{astro,tsx,ts,jsx,js,mdx}',
...sharedConfig.content
]
};

View File

@@ -0,0 +1,9 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@shared/*": ["../packages/shared/src/*"]
}
}
}