feat(phase-0): setup Docker Compose with TypeScript monorepo structure

- Create monorepo structure with apps/ and packages/
- Add Docker Compose for api, web, db, redis, worker services
- Migrate existing Express.js logic to TypeScript with 100% backward compatibility
- Preserve all existing API endpoints (/api/track, /api/v1/track) with identical behavior
- Setup development environment with hot reload and proper networking
- Add comprehensive TypeScript configuration with path mapping
- Include production-ready Dockerfiles with multi-stage builds
- Maintain existing rate limiting (100 req/hour/IP) and response formats
- Add health checks and graceful shutdown handling
- Setup Turbo for efficient monorepo builds and development
This commit is contained in:
Andrei
2025-08-18 07:03:08 +00:00
parent fb63d91b7d
commit 956f1aeadb
28 changed files with 1748 additions and 14 deletions

51
apps/api/package.json Normal file
View File

@@ -0,0 +1,51 @@
{
"name": "@redirect-intelligence/api",
"version": "2.0.0",
"private": true,
"scripts": {
"dev": "tsx watch --clear-screen=false src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"test": "jest",
"test:watch": "jest --watch",
"lint": "eslint src --ext .ts,.tsx",
"lint:fix": "eslint src --ext .ts,.tsx --fix",
"clean": "rm -rf dist"
},
"dependencies": {
"express": "^4.18.2",
"cors": "^2.8.5",
"cookie-parser": "^1.4.6",
"express-rate-limit": "^7.1.5",
"rate-limiter-flexible": "^3.0.8",
"axios": "^1.6.7",
"undici": "^6.2.1",
"zod": "^3.22.4",
"@prisma/client": "*",
"argon2": "^0.31.2",
"jsonwebtoken": "^9.0.2",
"bullmq": "^4.15.4",
"ioredis": "^5.3.2",
"helmet": "^7.1.0",
"compression": "^1.7.4",
"dotenv": "^16.3.1",
"jsdom": "^23.0.1",
"winston": "^3.11.0"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/cors": "^2.8.17",
"@types/cookie-parser": "^1.4.6",
"@types/jsonwebtoken": "^9.0.5",
"@types/compression": "^1.7.5",
"@types/jsdom": "^21.1.6",
"@types/node": "^20.10.0",
"tsx": "^4.6.2",
"typescript": "^5.3.0",
"jest": "^29.7.0",
"@types/jest": "^29.5.8",
"ts-jest": "^29.1.1",
"supertest": "^6.3.3",
"@types/supertest": "^2.0.16"
}
}