A full-stack application that demonstrates Google OAuth 2.0 authentication, Redis-based rate limiting, and PostgreSQL persistence using modern backend and frontend tools.
- Google OAuth 2.0 authentication using Passport.js
- Session-based login/logout
- Random motivational quote generator
- Redis (Upstash) powered per-user rate limiting
- PostgreSQL + Prisma for user storage
- Protected API routes
- React frontend with rate limit indicators
- Node.js + Express
- Passport.js (Google OAuth 2.0)
- PostgreSQL
- Prisma ORM
- Redis (Upstash)
- express-session
- React (Vite)
- Fetch API
- Simple inline styling
- User clicks Login with Google
- Redirected to Google OAuth consent screen
- Google sends user data to
/auth/google/callback - User is created/fetched from PostgreSQL
- Session is stored using cookies
- Authenticated user can access protected routes
- Each logged-in user can fetch 5 quotes per minute
- Redis stores counters with TTL
- Headers returned to frontend:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset
PORT=4000 DATABASE_URL=postgresql://... GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret REDIS_URL=your_upstash_redis_url SESSION_SECRET=supersecret
Google OAuth 2.0 β Free Passport.js β Free Redis (Upstash free tier) β Free PostgreSQL (Neon free tier) β Free No payment method required for OAuth.