docs(engineering): add project audit report and improvement plan

This commit introduces a comprehensive engineering audit report for the Tootaio Studio project. The report is structured into documents covering architecture, code quality, performance, security, CI/CD, and
observability. It also includes a phased improvement roadmap and a set of `.patch` files to apply immediate fixes for content schemas, package scripts, and CI configuration.
This commit is contained in:
xiaomai
2025-11-06 10:15:00 +08:00
parent 8cc04b7f59
commit 40b3ee147f
14 changed files with 744 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
diff --git a/content.config.ts b/content.config.ts
--- a/content.config.ts
+++ b/content.config.ts
@@
const defineIndexSchema = () =>
- z.object({
- capabilities: z.object({
- title: z.string(),
- features: z.array(
- z.object({
- title: z.string(),
- description: z.string(),
- icon: z.string(),
- })
- ),
- }),
- featuredProjects: z.object({
- title: z.string(),
- projects: z.array(
- z.object({
- title: z.string(),
- description: z.string(),
- image: z.string(),
- demoLink: z.string(),
- highlight: z.boolean(),
- spotlight: z.boolean(),
- })
- ),
- }),
- techStack: z.object({
- title: z.string(),
- }),
- whyChooseUs: z.object({
- title: z.string(),
- features: z.array(
- z.object({
- title: z.string(),
- description: z.string(),
- icon: z.string(),
- })
- ),
- }),
- });
+ z.object({
+ title: z.string(),
+ description: z.string(),
+ seo: z
+ .object({
+ title: z.string().optional(),
+ description: z.string().optional(),
+ })
+ .optional(),
+ capabilities: z.object({
+ title: z.string(),
+ features: z.array(
+ z.object({
+ title: z.string(),
+ description: z.string(),
+ icon: z.string().optional(),
+ })
+ ),
+ }),
+ featuredProjects: z.object({
+ title: z.string(),
+ projects: z.array(
+ z.object({
+ title: z.string(),
+ description: z.string(),
+ image: z.string(),
+ demoLink: z.string().url().optional(),
+ highlight: z.boolean().optional().default(false),
+ spotlight: z.boolean().optional().default(false),
+ })
+ ),
+ }),
+ techStack: z.object({
+ title: z.string(),
+ }),
+ whyChooseUs: z.object({
+ title: z.string(),
+ features: z.array(
+ z.object({
+ title: z.string(),
+ description: z.string(),
+ icon: z.string().optional(),
+ })
+ ),
+ }),
+ });

View File

@@ -0,0 +1,39 @@
diff --git a/package.json b/package.json
--- a/package.json
+++ b/package.json
@@
"scripts": {
- "build": "nuxt build",
- "dev": "nuxt dev",
- "generate": "nuxt generate",
- "preview": "nuxt preview",
- "postinstall": "nuxt prepare"
+ "build": "nuxt build",
+ "dev": "nuxt dev",
+ "generate": "nuxt generate",
+ "preview": "nuxt preview",
+ "postinstall": "nuxt prepare",
+ "typecheck": "nuxt typecheck",
+ "lint": "eslint --ext .ts,.js,.mjs,.vue --ignore-path .gitignore .",
+ "lint:fix": "pnpm lint -- --fix",
+ "check": "pnpm lint && pnpm typecheck && pnpm build"
},
@@
"dependencies": {
"@iconify-json/mdi": "^1.2.3",
"@nuxt/content": "3.8.0",
"@nuxt/eslint": "1.10.0",
"@nuxt/ui": "4.1.0",
"@nuxtjs/i18n": "10.2.0",
"@nuxtjs/seo": "3.2.2",
"better-sqlite3": "^12.4.1",
"eslint": "^9.39.0",
"nuxt": "^4.2.0",
"typescript": "^5.9.3",
"vue": "^3.5.22",
"vue-router": "^4.6.3"
- }
+ },
+ "engines": {
+ "node": ">=18.20.0"
+ }

View File

@@ -0,0 +1,34 @@
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
--- /dev/null
+++ b/.github/workflows/ci.yml
@@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Build
run: pnpm build

View File

@@ -0,0 +1,50 @@
diff --git a/nuxt.config.ts b/nuxt.config.ts
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@
export default defineNuxtConfig({
compatibilityDate: "2025-07-15",
devtools: { enabled: true },
modules: [
"@nuxt/content",
"@nuxt/ui",
"@nuxt/eslint",
"@nuxtjs/i18n",
"@nuxtjs/seo",
],
css: ["@/assets/css/main.css"],
app: {
head: {
titleTemplate: "%s - Tootaio Studio",
meta: [
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ charset: "utf-8" },
],
},
},
@@
seo: {
meta: {
title: DEFAULT_SEO.title,
description: DEFAULT_SEO.description,
keywords: DEFAULT_SEO.keywords,
ogTitle: DEFAULT_SEO.title,
ogDescription: DEFAULT_SEO.description,
ogImage: DEFAULT_SEO.image,
ogUrl: DEFAULT_SEO.url,
twitterCard: "summary_large_image",
twitterTitle: DEFAULT_SEO.title,
twitterDescription: DEFAULT_SEO.description,
twitterImage: DEFAULT_SEO.image,
},
},
site: {
url: "https://tootaio.com",
},
+ routeRules: {
+ "/": { prerender: true, swr: 3600 },
+ "/_nuxt/**": {
+ headers: { "cache-control": "public, max-age=31536000, immutable" },
+ },
+ },
});