mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 05:48:27 +01:00
In-memory rate limiting (LRU cache + Map) doesn't work correctly in serverless — each function instance has its own memory. Replace with a Supabase PostgreSQL function that atomically checks and increments per key, shared across all instances. - Add rate_limits table + check_rate_limit SQL function (migration 010) - Rewrite lib/rate-limit.ts to call Supabase RPC instead of LRU cache - Simplify lib/middleware/rate-limit.ts to wrap the new checkRateLimit - Update all 7 routes using the old LRU-based limiter - Remove lru-cache and @types/lru-cache dependencies - Auth routes (5) unchanged — they already use the middleware wrapper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
84 lines
2.3 KiB
JSON
84 lines
2.3 KiB
JSON
{
|
|
"name": "botsmann",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"build:ci": "npm ci && npm run build",
|
|
"start": "next start",
|
|
"test": "jest",
|
|
"test:e2e": "NODE_ENV=test playwright test",
|
|
"test:watch": "jest --watch",
|
|
"test:db": "tsx scripts/test-db-connection.ts",
|
|
"lint": "next lint --max-warnings 0",
|
|
"lint:fix": "next lint --fix",
|
|
"format": "prettier --write .",
|
|
"format:check": "prettier --check .",
|
|
"prepare": "husky install",
|
|
"lint-staged": "lint-staged"
|
|
},
|
|
"dependencies": {
|
|
"@aws-sdk/client-ses": "^3.980.0",
|
|
"@giscus/react": "^3.1.0",
|
|
"@headlessui/react": "^2.2.0",
|
|
"@supabase/ssr": "^0.8.0",
|
|
"@supabase/supabase-js": "^2.47.10",
|
|
"@tailwindcss/forms": "^0.5.7",
|
|
"@tailwindcss/typography": "^0.5.16",
|
|
"@vercel/analytics": "^1.6.1",
|
|
"@xenova/transformers": "^2.17.2",
|
|
"autoprefixer": "^10.4.17",
|
|
"date-fns": "^4.1.0",
|
|
"gray-matter": "^4.0.3",
|
|
"next": "^14.2.35",
|
|
"next-mdx-remote": "^5.0.0",
|
|
"pdf-parse": "^2.4.5",
|
|
"postcss": "^8.4.35",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.3.1",
|
|
"react-hook-form": "^7.54.2",
|
|
"react-icons": "^5.5.0",
|
|
"rehype-autolink-headings": "^7.1.0",
|
|
"rehype-slug": "^6.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"sonner": "^2.0.7",
|
|
"tailwindcss": "^3.4.1",
|
|
"zod": "^3.24.1"
|
|
},
|
|
"overrides": {
|
|
"glob": "^10.5.0",
|
|
"fast-xml-parser": "^5.3.4"
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.49.0",
|
|
"@testing-library/jest-dom": "^6.6.3",
|
|
"@types/jest": "^29.5.14",
|
|
"@types/node": "^20.17.17",
|
|
"@types/react": "^18.2.45",
|
|
"@types/react-dom": "^18.2.0",
|
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
"@typescript-eslint/parser": "^6.21.0",
|
|
"daisyui": "^5.0.43",
|
|
"eslint": "^8.57.1",
|
|
"eslint-config-next": "^14.2.35",
|
|
"eslint-config-prettier": "^9.1.0",
|
|
"eslint-plugin-prettier": "^5.2.1",
|
|
"husky": "^9.1.6",
|
|
"jest": "^29.7.0",
|
|
"jest-environment-jsdom": "^29.7.0",
|
|
"lint-staged": "^15.2.10",
|
|
"node-mocks-http": "^1.17.2",
|
|
"prettier": "^3.3.3",
|
|
"ts-jest": "^29.2.5",
|
|
"typescript": "^5.7.3"
|
|
},
|
|
"lint-staged": {
|
|
"*.{js,jsx,ts,tsx}": [
|
|
"eslint --cache --fix",
|
|
"prettier --write"
|
|
],
|
|
"*.{json,md,css,scss,html,yml,yaml}": "prettier --write"
|
|
}
|
|
}
|