Skip to content

Latest commit

Β 

History

History
134 lines (90 loc) Β· 3.1 KB

File metadata and controls

134 lines (90 loc) Β· 3.1 KB

πŸ“ Versioned Notes App

A full-stack note-taking application with automatic version control. Built with FastAPI (Python) for the backend and Streamlit for the frontend, this app allows users to create, view, and search notes β€” each update creating a new version.


πŸ”§ Tech Stack

  • Backend: FastAPI + SQLite
  • Frontend: Streamlit (React under the hood)
  • Search Autocomplete: Custom Trie-based prefix matching
  • Data Persistence: SQLite (auto-generated on startup)

✨ Features

  • πŸ” Create notes with title, content, and tags
  • πŸ•“ Each update creates a new version automatically
  • πŸ” Smart title-based search using Trie data structure
  • πŸ—‚οΈ View note content and all versions
  • πŸ†• Create notes via a separate tab
  • πŸ”— View full notes in a new browser tab
  • πŸ’Ύ Simple local database (SQLite)

πŸ“ Project Structure

versioned-notes-api/
β”œβ”€β”€ main.py                 # FastAPI app entry
β”œβ”€β”€ crud.py                 # DB access logic
β”œβ”€β”€ models.py               # Pydantic schemas
β”œβ”€β”€ database.py             # SQLite setup
β”œβ”€β”€ routers/
β”‚   └── notes.py            # API routes
β”œβ”€β”€ trie.py                 # TitleTrie class
β”œβ”€β”€ streamlit_frontend.py   # Main UI (search/view)
β”œβ”€β”€ new_note_form.py        # Create new note page
β”œβ”€β”€ view_note.py            # Full-screen note viewer
β”œβ”€β”€ requirements.txt
└── README.md

πŸš€ How to Run the Project

1️⃣ Clone the Repository

git clone https://github.com/your-username/versioned-notes-api.git
cd versioned-notes-api

2️⃣ Install Dependencies

pip install -r requirements.txt

This includes fastapi, uvicorn, pydantic, streamlit, and requests.


3️⃣ Start the FastAPI Backend

uvicorn main:app --reload

Runs on: http://localhost:8000


4️⃣ Start the Streamlit Apps

Open 3 terminals and run:

πŸ–₯️ Viewer UI (search + versions):

streamlit run streamlit_frontend.py

πŸ†• New Note Form:

streamlit run new_note_form.py --server.port 8502

πŸ”— Note Viewer:

streamlit run view_note.py --server.port 8503

Then visit:


🧠 Smart Search (Trie)

A custom TitleTrie is used to support fast title-based prefix matching and metadata retrieval. It auto-loads from the DB on startup.

GET /search-title?q=proj
β†’ returns matches: [{ title, version, timestamp }]

βœ… Future Enhancements

  • ✏️ Editable notes (update latest version)
  • πŸ” Diff between versions
  • πŸ—ƒοΈ Export notes as .txt or .pdf
  • πŸ” Add user authentication
  • ☁️ Deploy via Render, Railway or HuggingFace Spaces

πŸ“œ License

MIT License Β© 2025 Paul Gaikwad


Built to never lose track of your thoughts β€” one version at a time.