The below outlines how Kaizen’s architecture and technology choices protect your application against common security threats. Our stack is designed with security-first principles while remaining developer-friendly.
Convex Analytics provides visibility into API usage and potential abuse
Remember that no system is 100% secure, but Kaizen implements industry best practices across the stack. The architecture uses battle-tested cloud services that handle billions of requests daily, each with dedicated security teams and infrastructure.If you have specific security requirements or concerns, please reach out to the community on Discord or GitHub.
Security should be a priority from day one. While you can iterate on features, security breaches can be catastrophic for early-stage companies.A good boilerplate and infrastructure will usually cover the basics, but you should always be on the lookout for new threats and vulnerabilities.
We’ve gathered some resources below to help you get started.
Kaizen leverages Convex’s built-in rate limiting capabilities to protect your API endpoints from abuse. Convex provides serverless-friendly rate limiting that scales automatically with your application.
Rate limiting is crucial for protecting your API endpoints from abuse and ensuring fair usage.
Configure rate limiting in your Convex functionsConvex provides built-in rate limiting that you can configure in your function definitions:
Copy
// In your Convex functionexport const myFunction = internalAction({ args: { /* your args */ }, handler: async (ctx, args) => { // Your function logic here }, // Rate limiting configuration rateLimit: { requests: 20, window: "10s" }});
Different rate limits for different endpointsYou can set different rate limits based on the sensitivity of your endpoints:
Copy
// Sensitive operations (auth, payments)export const sensitiveFunction = internalAction({ args: { /* your args */ }, handler: async (ctx, args) => { // Your function logic here }, rateLimit: { requests: 5, window: "1m" }});// Regular API operationsexport const regularFunction = internalAction({ args: { /* your args */ }, handler: async (ctx, args) => { // Your function logic here }, rateLimit: { requests: 50, window: "30s" }});
Send multiple rapid requests to a Convex functionYou can use the Convex dashboard or your application to send multiple requests to a rate-limited function.
Check rate limit responsesWhen rate limits are exceeded, Convex will return appropriate error responses with rate limit information.
Monitor in Convex dashboardThe Convex dashboard provides visibility into rate limiting and API usage patterns.
Create a production Upstash Redis databaseFollow the same steps as for development, but choose an appropriate plan and region for your production needs.
Add environment variables to your hosting platformAdd the Upstash credentials to your hosting platform (e.g., Vercel, Netlify):
UPSTASH_REDIS_REST_URL
UPSTASH_REDIS_REST_TOKEN
Using Vercel integration (recommended)If you’re deploying to Vercel, you can use the Upstash integration:a. Go to the Vercel dashboard for your projectb. Navigate to “Settings” > “Integrations”c. Search for “Upstash” and click “Add Integration”d. Follow the steps to link your Upstash accounte. Select your Redis database to connect to your Vercel projectThis will automatically set up the environment variables for you.