build(backend): set up TypeScript with strict mode and build script

This commit is contained in:
Paul Huliganga 2026-03-23 23:45:09 -04:00
parent ed1f4f88be
commit 07b9be50b9
3 changed files with 8 additions and 5 deletions

View File

@ -9,7 +9,7 @@
### Backend Setup ### Backend Setup
- [x] Initialize Node.js backend: Create src/backend/, package.json with express, better-sqlite3, zod, vitest. Create src/backend/index.ts with "Hello World" server on port 3000. Verify: npm install && npm run dev (server starts). Commit as "feat(backend): initialize Node.js project with Express" - [x] Initialize Node.js backend: Create src/backend/, package.json with express, better-sqlite3, zod, vitest. Create src/backend/index.ts with "Hello World" server on port 3000. Verify: npm install && npm run dev (server starts). Commit as "feat(backend): initialize Node.js project with Express"
- [ ] Set up TypeScript: Create tsconfig.json (strict mode, ES2022, Node16 module resolution). Add build script to package.json. Verify: npm run build succeeds. Commit. - [x] Set up TypeScript: Create tsconfig.json (strict mode, ES2022, Node16 module resolution). Add build script to package.json. Verify: npm run build succeeds. Commit.
- [ ] Create SQLite schema: Create src/backend/db/schema.sql with recipes, tags, recipe_tags tables per ARCHITECTURE.md. Create src/backend/db/migrate.ts to apply schema. Verify: npm run migrate creates data/recipes.db. Commit. - [ ] Create SQLite schema: Create src/backend/db/schema.sql with recipes, tags, recipe_tags tables per ARCHITECTURE.md. Create src/backend/db/migrate.ts to apply schema. Verify: npm run migrate creates data/recipes.db. Commit.
- [ ] Implement recipe CRUD API endpoints - [ ] Implement recipe CRUD API endpoints
- [ ] Add Zod validation schemas - [ ] Add Zod validation schemas

View File

@ -6,6 +6,7 @@
"main": "src/backend/index.ts", "main": "src/backend/index.ts",
"scripts": { "scripts": {
"dev": "ts-node src/backend/index.ts", "dev": "ts-node src/backend/index.ts",
"build": "tsc",
"test": "vitest", "test": "vitest",
"migrate": "ts-node-esm src/backend/db/migrate.ts" "migrate": "ts-node-esm src/backend/db/migrate.ts"
}, },

View File

@ -3,12 +3,14 @@
"target": "ES2022", "target": "ES2022",
"module": "Node16", "module": "Node16",
"lib": ["ES2022"], "lib": ["ES2022"],
"rootDir": "src",
"outDir": "dist",
"strict": true, "strict": true,
"moduleResolution": "Node16",
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true
"moduleResolution": "Node16",
"outDir": "dist"
}, },
"include": ["src/**/*.ts"] "include": ["src"],
"exclude": ["node_modules", "dist"]
} }