Add free tier rate limiting with Upstash Redis and API key handling

This commit is contained in:
Riccardo Giorato
2025-12-25 16:04:00 +01:00
parent d5b163e586
commit 79bd750630
14 changed files with 571 additions and 74 deletions
+39 -2
View File
@@ -101,6 +101,12 @@ importers:
'@radix-ui/react-tooltip':
specifier: 1.1.6
version: 1.1.6(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
'@upstash/ratelimit':
specifier: ^2.0.7
version: 2.0.7(@upstash/redis@1.36.0)
'@upstash/redis':
specifier: ^1.36.0
version: 1.36.0
'@vercel/analytics':
specifier: 1.3.1
version: 1.3.1(next@16.1.1(react-dom@19.2.0(react@19.2.0))(react@19.2.0))(react@19.2.0)
@@ -121,7 +127,7 @@ importers:
version: 4.1.0
drizzle-orm:
specifier: ^0.45.1
version: 0.45.1(@neondatabase/serverless@1.0.2)(@types/pg@8.16.0)
version: 0.45.1(@neondatabase/serverless@1.0.2)(@types/pg@8.16.0)(@upstash/redis@1.36.0)
embla-carousel-react:
specifier: 8.5.1
version: 8.5.1(react@19.2.0)
@@ -1994,6 +2000,18 @@ packages:
'@types/react@19.2.7':
resolution: {integrity: sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==}
'@upstash/core-analytics@0.0.10':
resolution: {integrity: sha512-7qJHGxpQgQr9/vmeS1PktEwvNAF7TI4iJDi8Pu2CFZ9YUGHZH4fOP5TfYlZ4aVxfopnELiE4BS4FBjyK7V1/xQ==}
engines: {node: '>=16.0.0'}
'@upstash/ratelimit@2.0.7':
resolution: {integrity: sha512-qNQW4uBPKVk8c4wFGj2S/vfKKQxXx1taSJoSGBN36FeiVBBKHQgsjPbKUijZ9Xu5FyVK+pfiXWKIsQGyoje8Fw==}
peerDependencies:
'@upstash/redis': ^1.34.3
'@upstash/redis@1.36.0':
resolution: {integrity: sha512-9zN2UV9QJGPnXfWU3yZBLVQaqqENDh7g+Y4J2vJuSxBCi9FQ0aUOtaXlzuFhnsiZvCqM+eS27ic+tgmkWUsfOg==}
'@vercel/analytics@1.3.1':
resolution: {integrity: sha512-xhSlYgAuJ6Q4WQGkzYTLmXwhYl39sWjoMA3nHxfkvG+WdBT25c563a7QhwwKivEOZtPJXifYHR1m2ihoisbWyA==}
peerDependencies:
@@ -2709,6 +2727,9 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
uncrypto@0.1.3:
resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==}
undici-types@6.21.0:
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
@@ -4890,6 +4911,19 @@ snapshots:
dependencies:
csstype: 3.2.3
'@upstash/core-analytics@0.0.10':
dependencies:
'@upstash/redis': 1.36.0
'@upstash/ratelimit@2.0.7(@upstash/redis@1.36.0)':
dependencies:
'@upstash/core-analytics': 0.0.10
'@upstash/redis': 1.36.0
'@upstash/redis@1.36.0':
dependencies:
uncrypto: 0.1.3
'@vercel/analytics@1.3.1(next@16.1.1(react-dom@19.2.0(react@19.2.0))(react@19.2.0))(react@19.2.0)':
dependencies:
server-only: 0.0.1
@@ -5027,10 +5061,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
drizzle-orm@0.45.1(@neondatabase/serverless@1.0.2)(@types/pg@8.16.0):
drizzle-orm@0.45.1(@neondatabase/serverless@1.0.2)(@types/pg@8.16.0)(@upstash/redis@1.36.0):
optionalDependencies:
'@neondatabase/serverless': 1.0.2
'@types/pg': 8.16.0
'@upstash/redis': 1.36.0
electron-to-chromium@1.5.267: {}
@@ -5512,6 +5547,8 @@ snapshots:
typescript@5.9.3: {}
uncrypto@0.1.3: {}
undici-types@6.21.0: {}
update-browserslist-db@1.2.3(browserslist@4.28.1):