Add comprehensive TypeScript support and conversion

- Convert entire backend to TypeScript with strict type checking
- Add comprehensive type definitions and interfaces
- Create typed models for Location and ProfanityWord with database operations
- Convert all services to TypeScript (DatabaseService, ProfanityFilterService)
- Convert all API routes with proper request/response typing
- Add TypeScript build system and development scripts
- Update package.json with TypeScript dependencies and scripts
- Configure tsconfig.json with strict typing and build settings
- Update CLAUDE.md documentation for TypeScript development
- Add .gitignore rules for TypeScript build artifacts

Architecture improvements:
- Full type safety throughout the application
- Typed database operations and API endpoints
- Proper error handling with typed exceptions
- Strict optional property handling
- Type-safe dependency injection for routes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Code 2025-07-05 21:15:29 -04:00
parent 1c0e0ba532
commit c4cf921a54
14 changed files with 1993 additions and 25 deletions

View file

@ -2,15 +2,19 @@
"name": "great-lakes-ice-report",
"version": "1.0.0",
"description": "Great Lakes Ice Report - Community-driven winter road conditions tracker for Michigan",
"main": "server.js",
"main": "dist/server.js",
"scripts": {
"start": "npm run build && node server.js",
"dev": "npm run build-css && nodemon server.js",
"start": "npm run build && node dist/server.js",
"dev": "npm run build-css && npm run dev:ts",
"dev:ts": "concurrently \"tsc --watch\" \"nodemon dist/server.js\"",
"dev:js": "npm run build-css && nodemon server.js",
"build-css": "sass src/scss/main.scss public/style.css --style=compressed",
"build-css:dev": "sass src/scss/main.scss public/style.css --style=expanded --source-map",
"watch-css": "sass src/scss/main.scss public/style.css --watch --style=expanded --source-map",
"dev-with-css": "concurrently \"npm run watch-css\" \"npm run dev\"",
"build": "npm run build-css",
"dev-with-css:ts": "concurrently \"npm run watch-css\" \"npm run dev:ts\"",
"build": "npm run build:ts && npm run build-css",
"build:ts": "tsc",
"test": "jest --runInBand --forceExit",
"test:coverage": "jest --coverage",
"postinstall": "npm run build-css"
@ -23,11 +27,18 @@
"sqlite3": "^5.1.6"
},
"devDependencies": {
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/node": "^24.0.10",
"@types/node-cron": "^3.0.11",
"@types/sqlite3": "^3.1.11",
"concurrently": "^9.2.0",
"jest": "^29.7.0",
"nodemon": "^3.0.1",
"nodemon": "^3.1.10",
"sass": "^1.89.2",
"supertest": "^6.3.4"
"supertest": "^6.3.4",
"ts-node": "^10.9.2",
"typescript": "^5.8.3"
},
"keywords": [
"ice",