NoteSage is a web application for generating, saving, and sharing study notes using AI. It combines a Next.js frontend with server-side API routes, Clerk authentication, and a MongoDB backend. The app allows users to generate notes from prompts, save them to a personal library, and publish posts to community topics.
Key features
- AI-powered notes generation (server-side LLM integration)
- Save, edit and export notes (PDF)
- Publish notes as posts in topic feeds
- User authentication with Clerk
- Community features: Explore topics, upvote/downvote posts
This project uses the following core libraries and services (links go to their official GitHub repositories or homepages):
This list highlights the main technologies used in the app. Click the badges to go to the official project pages or repos.
- Quick start
- Environment
- Scripts
- Architecture overview
- Development notes
- Contributing
- Troubleshooting
- License
- Clone the repository and install dependencies:
git clone https://github.com/Soham-Donode/notesage.git
cd notesage
npm install-
Create environment variables (see Environment or copy
.env.exampleto.env.local). -
Run the development server:
npm run devOpen http://localhost:3000 in your browser.
For a production build:
npm run build
npm run startAdd screenshots to public/screenshots/ and reference them here. Two suggested placeholders are provided below — replace the image paths with real screenshots when available.
Lander / Home page preview
Notes
- Create
public/screenshots/and addlander-preview.pngandgeneration-preview.png(recommended size: 1200×700px). - Use descriptive captions and alternate text for accessibility.
Copy .env.example to .env.local and fill the values. Do NOT commit secrets to the repository.
Required variables (used throughout the codebase):
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_... # Clerk client key (exposed to client)
- CLERK_SECRET_KEY=sk_... # Clerk server secret (server-only)
- CLERK_WEBHOOK_SECRET=whsec_... # Clerk webhook verification secret
- GEMINI_API_KEY=... # Google/LLM API key used by server-side generation routes
- MONGODB_URI=mongodb+srv://:@cluster.example.net/?retryWrites=true&w=majority
Optional / helpful variables:
- NODE_ENV=development|production
- PORT=3000
- NEXTAUTH_URL=https://your-domain.com # if deploying with providers that require it
Notes
- Variables prefixed with
NEXT_PUBLIC_are available in client bundles. - Keep server-only keys out of client code and Git.
npm run dev— Start Next.js in development modenpm run build— Build for productionnpm run start— Start the production server (after build)npm run lint— Run ESLint
- Frontend: Next.js (App Router) + TypeScript + Tailwind CSS
- Auth: Clerk (sign-up, sign-in, webhooks for user lifecycle)
- Backend: Next.js API routes for notes, posts, generation, refactor, and webhooks
- Database: MongoDB via Mongoose (connection in
lib/mongodb.ts) - AI: Server-side integration with a generative model (configured in
app/api/generate/route.ts)
Key folders
app/— Next.js app routes and pagesapp/api/— Serverless API routes (generation, posts, notes, webhooks, etc.)components/— Reusable React componentslib/— Helpers (MongoDB connector, utilities)models/— Mongoose models:User,Post,Note
- Search overlay:
components/SearchOverlay.tsxprovides a site-wide search UI and is wired to theNavBarvia theonSearchClickprop. - LLM keys: Generation happens on the server. The routes expect
GEMINI_API_KEYto be set server-side. There are helper routes to test the key. - Webhooks: Clerk webhooks are verified using
CLERK_WEBHOOK_SECRETinapp/api/webhooks/clerk/route.ts.
Quality gates
- The project enforces ESLint rules which can fail the production build if not satisfied. Run
npm run lintand fix issues before opening PRs.
Contributions are welcome. A minimal workflow:
- Fork the repository
- Create a branch:
git checkout -b feat/your-feature - Make changes and run tests/lint
- Commit and push:
git push origin feat/your-feature - Open a Pull Request describing your changes
Please include a short description and link to any related issue.
- Build fails with ESLint errors: run
npm run lintand address reported issues. Some TypeScriptanyusages are flagged by@typescript-eslint/no-explicit-any. GEMINI_API_KEYerrors: verify the key is valid and that the server has access to it. There is an API routeapp/api/test-key/route.tsto help validate the key.- Clerk webhooks not verified: ensure
CLERK_WEBHOOK_SECRETmatches the secret in your Clerk dashboard and your webhook endpoint URL is correctly configured.
If you hit issues not listed here, open an issue with logs and reproduction steps.
This repository does not include a license file. If you plan to open source it, add a LICENSE (for example MIT) and update this section.
Last updated: 2025-11-10
StudyFlow is an innovative web application designed to help students generate comprehensive, personalized notes using AI. The platform fosters collaborative learning, allowing students to share notes, form study groups, and connect with peers.
- Personalized Notes: Provide a subject prompt and select a format (summary, flashcards, Q&A) to generate notes tailored to your learning style.
- LLM Integration: Leverages a powerful Large Language Model for high-quality, relevant notes.
- Save & Organize: Save generated notes to a personal dashboard for easy access and organization.
- Monetized Blogs: Publish generated notes as blog posts with public previews. Monetize your content and showcase expertise.
- Study Groups: Create and join study groups for real-time discussion and collaborative learning.
Frontend & Backend
- Next.js: React framework for fast, scalable, server-rendered web apps. Handles UI and backend API routes.
- Tailwind CSS: Utility-first CSS framework for custom designs and responsive layouts.
Database & Backend Services
- Supabase: Open-source Firebase alternative with PostgreSQL, authentication, and real-time features.
Authentication
- Clerk: User management and authentication service for sign-up, sign-in, and session management.
LLM Integration
- LLM API: API from a Large Language Model provider (e.g., OpenAI, Anthropic) powers notes generation.
Other Tools & Libraries
- Tiptap: Headless rich text editor for creating and editing notes and blog posts.
- Git & GitHub: Version control and team collaboration with branches and pull requests.
To get a local copy up and running:
-
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.env.localfile in the project root. - Add your Clerk, MongoDB, LLM API keys, and webhook secret:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=... CLERK_SECRET_KEY=... GEMINI_API_KEY=... MONGODB_URI=... CLERK_WEBHOOK_SECRET=...
- Create a
-
Set up Clerk webhooks:
- In your Clerk Dashboard, go to Webhooks.
- Add a new webhook endpoint:
https://your-domain.com/api/webhooks/clerk - Select events:
user.created,user.updated,user.deleted - Copy the webhook secret and add it to
CLERK_WEBHOOK_SECRETin.env.local
-
Run the development server:
npm run dev
Open http://localhost:3000 in your browser.
We welcome contributions! Please follow the standard Git workflow:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m 'feat: Add new feature' - Push to the branch:
git push origin feature/your-feature
- Create a Pull Request.
Phase 1: Core Functionality (MVP)
- User authentication and profile management
- Notes generation with LLM integration
- Saving and displaying user-generated notes
Phase 2: Community Features
- Publishing notes as public blog posts
- Basic monetization implementation
Phase 3: Collaboration
- Real-time study group chat functionality
- Advanced note sharing and collaborative editing
This README provides a comprehensive overview of the project for your team and potential collaborators.
Create a .env.local file in the project root to hold secrets and API keys used by the app. This repository's .gitignore already ignores .env*, so .env.local will not be committed by default.
Required variables (use your provider keys):
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY— Clerk publishable key (safe to expose to client).CLERK_SECRET_KEY— Clerk secret key (server-only).GEMINI_API_KEY— LLM/Google API key used for generation.MONGODB_URI— MongoDB connection string.
Example (.env.local):
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...
GEMINI_API_KEY=your_llm_key_here
MONGODB_URI=mongodb+srv://<user>:<password>@cluster.example.net/<db>?retryWrites=true&w=majority
Quick verification:
- Start the dev server:
npm run dev- In Next.js, variables prefixed with
NEXT_PUBLIC_are available on the client; others are server-only. You can logprocess.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYfrom a client component to verify it's loaded.
Security notes:
- Do not commit
.env.localor secret keys. Rotate any keys you believe were exposed publicly. - If secrets were accidentally committed, remove them from history (for example, using
git filter-repoor contacting your Git host support) and rotate the keys.
