Skip to content

kabir-asija/QuoteFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Quote App - OAuth + Redis Rate Limiting

A full-stack application that demonstrates Google OAuth 2.0 authentication, Redis-based rate limiting, and PostgreSQL persistence using modern backend and frontend tools.


πŸš€ Features

  • 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

🧱 Tech Stack

Backend

  • Node.js + Express
  • Passport.js (Google OAuth 2.0)
  • PostgreSQL
  • Prisma ORM
  • Redis (Upstash)
  • express-session

Frontend

  • React (Vite)
  • Fetch API
  • Simple inline styling

πŸ”‘ Authentication Flow (Google OAuth)

  1. User clicks Login with Google
  2. Redirected to Google OAuth consent screen
  3. Google sends user data to /auth/google/callback
  4. User is created/fetched from PostgreSQL
  5. Session is stored using cookies
  6. Authenticated user can access protected routes

⚑ Rate Limiting with Redis

  • Each logged-in user can fetch 5 quotes per minute
  • Redis stores counters with TTL
  • Headers returned to frontend:
    • X-RateLimit-Limit
    • X-RateLimit-Remaining
    • X-RateLimit-Reset

Environment variables

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

πŸ†“ Cost & Billing

Google OAuth 2.0 β†’ Free Passport.js β†’ Free Redis (Upstash free tier) β†’ Free PostgreSQL (Neon free tier) β†’ Free No payment method required for OAuth.

About

Full-stack Quote App with Google OAuth authentication and Redis-based rate limiting.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors