generated from AOSSIE-Org/Template-Repo
-
-
Notifications
You must be signed in to change notification settings - Fork 16
feat(storage): Adds the complete storage layer for the Smart Notes vault system. #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Nihallllll
wants to merge
2
commits into
AOSSIE-Org:main
Choose a base branch
from
Nihallllll:feat/storage-layer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # dependencies (bun install) | ||
| node_modules | ||
|
|
||
| # output | ||
| out | ||
| dist | ||
| *.tgz | ||
|
|
||
| # code coverage | ||
| coverage | ||
| *.lcov | ||
|
|
||
| # logs | ||
| logs | ||
| *.log | ||
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
|
||
| # dotenv environment variable files | ||
| .env | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| .env.local | ||
|
|
||
| # caches | ||
| .eslintcache | ||
| .cache | ||
| *.tsbuildinfo | ||
|
|
||
| # IntelliJ based IDEs | ||
| .idea | ||
|
|
||
| # Finder (MacOS) folder config | ||
| .DS_Store | ||
|
|
||
| # Test vaults created by demo.ts / test runs | ||
| test-vault/ | ||
| demo-vault/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Smart Notes Storage | ||
|
|
||
| What it does — in plain terms | ||
| Vault (the notes folder) | ||
| Open any folder as a vault | ||
| Re-opening the same folder is safe — nothing breaks or duplicates | ||
| Works even if you already have existing .md files in the folder | ||
| Notes | ||
| Create a note — writes a .md file, saves metadata to DB | ||
| Read a note — gives you the content + title + tags | ||
| Update a note — saves new content, keeps frontmatter intact | ||
| Rename a note — renames the file, updates the title inside the file | ||
| Move a note to a different folder | ||
| Delete a note — moves to trash by default, or permanent delete | ||
| Trash | ||
| Deleted notes go to a .trash folder, not permanently gone | ||
| List everything in the trash | ||
| Restore a trashed note back to its original location | ||
| Folders | ||
| Create a folder (with optional icon and pin-to-top) | ||
| Rename a folder — all notes inside automatically get their paths updated | ||
| Delete a folder — safely trashes all notes inside first | ||
| Tags | ||
| Attach tags to a note when creating or updating | ||
| Tags stored in both the DB and the .md file frontmatter | ||
| Filter notes by tag | ||
| List all tags in the vault with usage counts | ||
| Search | ||
| Search notes by title | ||
| Sorting & Pagination | ||
| List notes sorted by last updated, created date, or name | ||
| Limit results per page (useful for sidebars with many notes) | ||
| Conflict Detection | ||
| If a note was edited by another app (e.g. VS Code) while you had it open, it won't silently overwrite — saves a conflict copy and alerts you | ||
| File Watcher | ||
| Detects when any .md file is added, changed, or deleted outside your app | ||
| DB automatically stays in sync even if the user edits notes in another editor | ||
| Events | ||
| Every action fires an event (noteCreated, noteUpdated, noteDeleted, noteRenamed, noteMoved, folderCreated, folderRenamed, folderDeleted, conflictDetected) | ||
| Your UI just listens and reacts — no polling needed | ||
| RAG / AI pipeline bridge | ||
| Tells the RAG pipeline which notes need to be embedded (new, changed, or previously failed) | ||
| Tells the RAG pipeline which notes changed since a specific time (for incremental updates) | ||
| Lets the RAG pipeline report back when it finishes indexing a note | ||
| Bulk-read all notes with content in one call for initial indexing | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add trailing newline at end of file. The file should end with a single newline character per Markdown conventions (MD047). 🧰 Tools🪛 markdownlint-cli2 (0.21.0)[warning] 45-45: Files should end with a single newline character (MD047, single-trailing-newline) 🤖 Prompt for AI Agents |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from "./src/index" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "name": "storage", | ||
| "module": "index.ts", | ||
| "type": "module", | ||
| "private": true, | ||
| "scripts": { | ||
| "test": "vitest run", | ||
| "test:watch": "vitest", | ||
| "demo": "bun run demo.ts", | ||
| "typecheck": "tsc --noEmit" | ||
| }, | ||
| "dependencies": { | ||
| "better-sqlite3": "^12.6.2", | ||
| "chokidar": "^5.0.0", | ||
| "eventemitter3": "^5.0.4", | ||
| "gray-matter": "^4.0.3", | ||
| "js-yaml": "^4.1.0", | ||
| "uuid": "^13.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/better-sqlite3": "^7.6.13", | ||
| "@types/bun": "latest", | ||
| "@types/js-yaml": "^4.0.9", | ||
| "@types/node": "^25.3.3", | ||
| "@types/uuid": "^11.0.0", | ||
| "vitest": "^4.0.18" | ||
| }, | ||
| "peerDependencies": { | ||
| "typescript": "^5" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix markdownlint violations (MD041, MD047).
Add a top-level H1 at Line 1 and ensure the file ends with a single trailing newline.
📝 Proposed fix
(Also ensure one final newline at EOF.)
Also applies to: 43-43
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🤖 Prompt for AI Agents