feat: complete TASK-WP0-01 toolchain skeleton

This commit is contained in:
suyx
2026-07-27 17:13:01 +08:00
parent 67e7a17d96
commit ae20eaf01f
39 changed files with 3588 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
{
"name": "@dada/api",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "tsc -p tsconfig.json",
"start": "node dist/main.js",
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"dependencies": {
"@fastify/swagger": "9.8.1",
"@sinclair/typebox": "0.34.52",
"better-sqlite3": "13.0.1",
"drizzle-orm": "0.45.2",
"fastify": "5.10.0"
},
"devDependencies": {
"@types/better-sqlite3": "7.6.13",
"@types/node": "24.13.3",
"typescript": "7.0.2"
}
}
+17
View File
@@ -0,0 +1,17 @@
import swagger from "@fastify/swagger";
import Fastify from "fastify";
export function createApp() {
const app = Fastify({ logger: false });
void app.register(swagger, {
openapi: {
info: {
title: "Dada P0-A",
version: "0.0.0",
},
},
});
return app;
}
+8
View File
@@ -0,0 +1,8 @@
import { createApp } from "./app.js";
const app = createApp();
await app.listen({
host: "127.0.0.1",
port: 43121,
});
+12
View File
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2024"],
"types": ["node"],
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}