VC—01 Terminal-native intelligence
Code at
the speed of
thought.
VibeCoder is a terminal-native AI coding assistant that runs locally with Ollama. Private by default. Fast by design. Yours, entirely.
Installs in under 60 seconds. Runs on localhost.
›Add rate limiting to the API using Redis.
- Scan project and find API entry points
- Review existing middleware and Redis client
- Implement middleware and integrate
- Configure environment and run verification
- export function rateLimit(req, res, next) {
- next();
+ import { createClient } from 'redis';
+ const redis = createClient({ url: process.env.REDIS_URL });
+ const LIMIT = 100;
+ const WINDOW = 60;
+ export async function rateLimit(req, res, next) {
+ const ip = req.headers['x-forwarded-for'] || 'unknown';
+ const key = `rl:${req.ip}`;
+ const current = await redis.incr(key);
+ if (current === 1) {
+ await redis.expire(key, WINDOW);
+ }
+ res.setHeader('X-RateLimit-Limit', LIMIT);
+ res.setHeader('X-RateLimit-Remaining', Math.max(0, LIMIT - current));
+ if (current > LIMIT) {
+ res.setHeader('Retry-After', WINDOW);
+ return res.status(429);
+ }
+ next();
+ }
$ npm run test:rate-limit
All checks passed.