๐ 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_ptrandweak_ptrsmart 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
- Clone the repository
git clone https://github.com/Raqibreyaz/Notekeeper.git
cd Notekeeper- Clean Before Compiling
make clean- Compile the project
make- Run the application
make run๐ง Concepts Covered
- Managing dynamic memory with smart pointers
- Using
weak_ptrto 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_ifandstd::erase
๐ Author
Made with โค๏ธ by Raquib Reyaz