chore: scaffold local optimizer app

This commit is contained in:
Codex
2026-06-21 23:42:37 +08:00
parent 73f47a0f9a
commit 160fa52586
15 changed files with 9240 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4.1-mini
APP_DATA_DIR=./data
+4 -2
View File
@@ -1,9 +1,11 @@
.superpowers/
data/app.db
data/exports/
node_modules/
dist/
build/
.next/
.env
.env.*
!.env.example
data/app.db
data/exports/
*.log
+1
View File
@@ -0,0 +1 @@
+16
View File
@@ -0,0 +1,16 @@
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
];
export default eslintConfig;
+6
View File
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
+5
View File
@@ -0,0 +1,5 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {};
export default nextConfig;
+9040
View File
File diff suppressed because it is too large Load Diff
+38
View File
@@ -0,0 +1,38 @@
{
"name": "geo-agent-article-optimizer",
"version": "0.1.0",
"scripts": {
"test": "vitest run",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test:watch": "vitest"
},
"private": true,
"dependencies": {
"better-sqlite3": "^12.11.1",
"docx": "^9.7.1",
"nanoid": "^5.1.11",
"next": "^16.2.9",
"openai": "^6.42.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"zod": "^4.4.3"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^25.9.3",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.2",
"eslint": "^9.39.4",
"eslint-config-next": "^16.2.9",
"jsdom": "^29.1.1",
"playwright": "^1.61.0",
"prettier": "^3.8.4",
"tailwindcss": "^3.4.17",
"typescript": "^6.0.3",
"vitest": "^4.1.9"
}
}
+7
View File
@@ -0,0 +1,7 @@
const config = {
plugins: {
tailwindcss: {},
},
};
export default config;
+22
View File
@@ -0,0 +1,22 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
color-scheme: light;
background: #f8fafc;
color: #111827;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
font-family:
Arial,
Helvetica,
sans-serif;
}
+14
View File
@@ -0,0 +1,14 @@
import "./globals.css";
export const metadata = {
title: "GEO Agent Article Optimizer",
description: "Local article optimization and QA workflow",
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="zh-CN">
<body>{children}</body>
</html>
);
}
+27
View File
@@ -0,0 +1,27 @@
const sections = [
"Article Input",
"Fact Card",
"Optimized Result",
"Quality Report",
];
export default function Home() {
return (
<main className="mx-auto flex min-h-screen w-full max-w-6xl flex-col gap-8 px-6 py-10">
<h1 className="text-3xl font-semibold text-slate-950">
GEO Agent Article Optimizer
</h1>
<div className="grid gap-4 md:grid-cols-2">
{sections.map((section) => (
<section
key={section}
aria-label={section}
className="min-h-48 rounded-lg border border-slate-200 bg-white p-5 shadow-sm"
>
<h2 className="text-lg font-medium text-slate-900">{section}</h2>
</section>
))}
</div>
</main>
);
}
+15
View File
@@ -0,0 +1,15 @@
import type { Config } from "tailwindcss";
const config: Config = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {},
},
plugins: [],
};
export default config;
+34
View File
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": ["node_modules"]
}
+8
View File
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
environment: "jsdom",
passWithNoTests: true,
},
});