GitHunt

๐Ÿ“ Note Manager with JSON Persistence (C++)

A lightweight C++ project to manage notes using smart pointers (shared_ptr, weak_ptr) and JSON file persistence. Notes are cached for recent access and automatically cleaned up when deleted.


๐Ÿš€ Features

  • Add and view notes
  • Recent notes caching (with automatic cleanup of expired pointers)
  • Save and load notes from a JSON file
  • Uses shared_ptr and weak_ptr smart pointers
  • Minimal and easy to understand codebase

๐Ÿ›  Technologies

  • C++17
  • Smart Pointers: shared_ptr, weak_ptr
  • STL: vector, deque, fstream, algorithm
  • JSON Parsing: custom or 3rd-party (e.g., nlohmann/json) (mention what you use)

๐Ÿ“ Project Structure

๐Ÿ“ Notekeeper/
โ”œโ”€โ”€ ๐Ÿ“„ main.cpp                            # Entry point
โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ note/
โ”‚   โ”‚   โ”œโ”€โ”€ Note.cpp                      # Note class implementation
โ”‚   โ”‚   โ””โ”€โ”€ Note.hpp                      # Note class definition
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ cache/
โ”‚   โ”‚   โ”œโ”€โ”€ RecentNotesCache.cpp         # Handles recent note caching
โ”‚   โ”‚   โ””โ”€โ”€ RecentNotesCache.hpp
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ utils.cpp                    # JSON parsing logic
โ”‚   โ”‚   โ””โ”€โ”€ utils.hpp
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“ note-manager/
โ”‚       โ”œโ”€โ”€ NoteManager.cpp              # Logic to manage all notes
โ”‚       โ””โ”€โ”€ NoteManager.hpp
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ notes.json                         # Persistent note storage (auto-generated)
โ””โ”€โ”€ ๐Ÿ“„ README.md                          # Project documentation


๐Ÿ“ฆ How to Use

  1. Clone the repository
git clone https://github.com/Raqibreyaz/Notekeeper.git
cd Notekeeper
  1. Clean Before Compiling
make clean
  1. Compile the project
make
  1. Run the application
make run

๐Ÿง  Concepts Covered

  • Managing dynamic memory with smart pointers
  • Using weak_ptr to avoid memory leaks and cyclic references
  • File I/O in C++ using ifstream, ofstream
  • Working with JSON in a C++ environment
  • STL algorithms like std::remove_if and std::erase

๐Ÿ™Œ Author

Made with โค๏ธ by Raquib Reyaz


Raqibreyaz/Notekeeper | GitHunt