Skip to content

rajratan-rajput/ExamNotesAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ ExamNotesAI – AI Powered Credit-Based SaaS Platform


🌟 Overview

ExamNotesAI is a production-style AI-powered SaaS web application that allows users to generate smart exam notes using AI and purchase usage credits securely via Stripe.

This project demonstrates real-world backend architecture including secure authentication, payment gateway integration, webhook verification, and a credit-based transaction system.


🎯 Key Highlights

βœ” Implemented secure Google OAuth authentication using Firebase
βœ” Designed JWT-protected backend architecture
βœ” Integrated Stripe Checkout with webhook verification
βœ” Built a credit-based payment system using Stripe metadata validation
βœ” Integrated Google Gemini AI API for intelligent note generation
βœ” Connected MongoDB Atlas for scalable cloud database storage
βœ” Managed environment variables securely
βœ” Designed SaaS-style backend architecture

This reflects real startup-level SaaS backend implementation.


πŸ— Tech Stack

πŸ”Ή Frontend

  • React (Vite)
  • Firebase Authentication
  • Axios

πŸ”Ή Backend

  • Node.js
  • Express.js
  • MongoDB Atlas (Mongoose ODM)
  • JWT Authentication
  • Stripe API + Webhooks
  • Google Gemini API

πŸ“‚ Project Structure

ExamNotesAI/
β”‚
β”œβ”€β”€ client/          β†’ React Frontend
β”œβ”€β”€ server/          β†’ Node + Express Backend
β”œβ”€β”€ README.md
└── .gitignore

βš™οΈ Local Setup Guide

1️⃣ Clone Repository

git clone https://github.com/rajratan-rajput/ExamNotesAI.git
cd ExamNotesAI

2️⃣ Backend Setup

cd server
npm install

Create server/.env

PORT=8000
MONGODB_URL=your_mongodb_connection_string
JWT_SECRET=your_secret_key
GEMINI_API_KEY=your_gemini_api_key
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
CLIENT_URL=http://localhost:5173

Run backend:

npm run dev

3️⃣ Frontend Setup

cd client
npm install

Create client/.env

VITE_FIREBASE_APIKEY=your_firebase_api_key

Run frontend:

npm run dev

πŸ’³ Stripe Webhook Setup (Local Testing)

Login Stripe CLI:

stripe login

Start webhook listener:

stripe listen --forward-to localhost:8000/api/credits/webhook

Copy the whsec_ key into backend .env.


πŸ§ͺ Stripe Test Payment Card

4242 4242 4242 4242
Any future date
Any 3-digit CVC
Any 5-digit ZIP

πŸš€ Deployment Guide

πŸ”Ή Backend Deployment (Render / Railway)

  1. Push repository to GitHub
  2. Connect repository to Render
  3. Add environment variables in dashboard
  4. Build command:
npm install
  1. Start command:
node index.js

πŸ”Ή Frontend Deployment (Vercel / Netlify)

  1. Connect GitHub repository
  2. Build command:
npm run build
  1. Output directory:
dist
  1. Add environment variable:
VITE_FIREBASE_APIKEY

πŸ” Security Features

  • Stripe webhook signature verification
  • JWT-protected routes
  • Metadata-based secure credit allocation
  • Environment-based secret management
  • No sensitive keys exposed in frontend

πŸ“ˆ Future Improvements

  • Idempotent webhook handling
  • Payment transaction history logging
  • Subscription-based billing
  • Role-based access control
  • Production Stripe live mode integration
  • Cloud deployment optimization

πŸ‘¨β€πŸ’» Author

Rajratan Rajput
GitHub: https://github.com/rajratan-rajput

Full Stack Developer | MERN Stack | Backend Engineering


⭐ If you found this project valuable, consider giving it a star!

About

⚑ Production-style MERN SaaS app with πŸ’³ Stripe Checkout, πŸ” JWT security & πŸ€– AI-powered note generation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages