feat(web): checkpoint web app init

- frontend (Vite/React) + server (Hono/Drizzle) scaffold under web/
- eeschema WASM embind kicadOpenFile hook + programmatic open-flow
- skip KiCad first-run setup wizard by seeding default config in preRun
- dev: auto-sync output/ WASM artifacts into tests/apps/kicad via link-wasm

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gergő Törcsvári 2026-06-01 16:30:29 +02:00
commit 735e5aa8e9
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
70 changed files with 7775 additions and 13 deletions

View file

@ -0,0 +1,32 @@
import cors from "@fastify/cors";
import multipart from "@fastify/multipart";
import Fastify, { type FastifyInstance } from "fastify";
import { env } from "./env.js";
import { apiPlugin } from "./routes/api.js";
import { fileRoutes } from "./routes/files.js";
export async function buildApp(): Promise<FastifyInstance> {
const app = Fastify({
logger: true,
// Project files (whole KiCad trees) and zips can be large.
bodyLimit: 1024 * 1024 * 1024,
});
await app.register(cors, {
origin: env.CORS_ORIGIN === "*" ? true : env.CORS_ORIGIN.split(","),
});
await app.register(multipart, {
limits: {
fileSize: 1024 * 1024 * 1024, // 1 GiB per file
files: 5000, // a KiCad project can have many lib files
},
});
app.get("/health", async () => ({ ok: true }));
await app.register(apiPlugin);
await app.register(fileRoutes);
return app;
}