Skip to content

Zen-X5/AI-NoteApp-Summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Note Summarizer

A full-stack note summarization app that turns raw notes into clean, easy-to-read summaries.

What It Does

You write or paste a note in the frontend. The backend stores the note in MongoDB, sends the content to the Python AI service, receives a summarized version from the LLM, saves the updated text back to the database, and then refreshes the frontend so the new summary appears immediately.

Project Structure

  • frontend/ - Next.js UI for creating, editing, deleting, and summarizing notes
  • backend/ - NestJS API that manages chats, chat messages, and the summarize workflow
  • ai-service/ - FastAPI service that calls Groq through LangChain and returns the summary text
  • scripts/ - helper scripts used during setup

Demo

Demo Video

Click the thumbnail above to open the demo video.

How the Workflow Works

  1. The frontend sends a note to the NestJS backend.
  2. The backend stores the note in MongoDB.
  3. When you click the summarize button, the frontend calls POST /chatMessage/summarize.
  4. The backend forwards the note text to the AI service at POST /api/ai-service/summarize.
  5. The AI service sends the prompt to the LLM and returns a plain-language summary.
  6. The backend updates the original chat message in MongoDB with the summary.
  7. The frontend refetches the active chat messages so the updated text shows right away.

Prerequisites

  • Node.js 18+ or 20+
  • Python 3.10+ and pip
  • MongoDB running locally or a MongoDB connection string
  • A Groq API key for the AI service

Installation

1) Clone the repository

git clone <your-repo-url>
cd ai-note-summarizer

2) Set up the backend

cd backend
npm install

Create a .env file in backend/ with:

MONGO_URL=mongodb://127.0.0.1:27017/ai-note-summarizer
PORT=8000

3) Set up the AI service

cd ../ai-service
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

Create a .env file in ai-service/ with:

GROQ_API_KEY=your_groq_api_key_here

4) Set up the frontend

cd ../frontend
npm install

Running the Project

Open three terminals and start each service separately.

Backend

cd backend
npm run start:dev

Runs on http://localhost:8000 by default.

AI service

cd ai-service
uvicorn app:app --reload --port 8080

Runs on http://127.0.0.1:8080.

Frontend

cd frontend
npm run dev

Runs on http://localhost:3000.

Environment Variables

backend/.env

  • MONGO_URL - MongoDB connection string
  • PORT - backend port, defaults to 8000

ai-service/.env

  • GROQ_API_KEY - Groq API key used by the LLM client

API Overview

Backend

  • POST /chatMessage/postChatMessage
  • GET /chatMessage/getChatMessages/:chatId
  • PATCH /chatMessage/updateChatMessage/:id
  • DELETE /chatMessage/deleteChatMessage/:id
  • POST /chatMessage/summarize

AI Service

  • GET /
  • POST /api/ai-service/summarize

Behavior Notes

  • Summaries are saved back to the same chat message document.
  • The frontend refetches the active chat messages after summarizing.
  • The AI prompt is configured to return plain paragraph text, not markdown bullet lists.

Tech Stack

  • Frontend: Next.js, React, Redux Toolkit Query, Ant Design, Tailwind CSS
  • Backend: NestJS, MongoDB, Mongoose
  • AI service: FastAPI, LangChain, Groq

Troubleshooting

  • If summarization fails, make sure the backend can reach the AI service on port 8080.
  • If the backend cannot start, verify that MONGO_URL is set correctly.
  • If the AI service cannot start, verify that GROQ_API_KEY is present in ai-service/.env.
  • If the frontend does not show updated text, make sure all three services are running and the backend is returning the updated message.

License

This project is currently unlicensed in the repository.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors