Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ashish7802/SnipVault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

25 Commits

Repository files navigation


What is this?

You know that feeling when you've written a perfect regex, or a clean auth middleware, and then two weeks later you're digging through 6 old projects trying to find it?

That's what SnipVault solves.

It's a personal code snippet manager β€” you save snippets with tags and a language label, and later you just search and copy. That's it. No cloud, no account, runs locally.


Getting started

git clone https://github.com/ashish7802/SnipVault.git
cd SnipVault
# Backend
cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
# Frontend (new terminal)
cd frontend
npm install && npm run dev

Frontend runs on http://localhost:5173, API on http://localhost:8000, and Swagger docs at /docs.


Features

  • Save snippets with a title, language, tags, and optional description
  • Search by title or tag instantly
  • Syntax highlighted code blocks with one-click copy
  • Delete with a confirmation prompt
  • Fully local β€” SQLite, no external services

Why not just use Gists or Notes?

Gists are public by default and have no tag-based search. Notes apps don't do syntax highlighting. SnipVault is just a focused tool for one specific problem β€” storing and finding code you already wrote.


Stack

Backend is FastAPI + SQLAlchemy on SQLite. Frontend is React 18 with Vite and TailwindCSS. Syntax highlighting via react-syntax-highlighter.


Project structure

SnipVault/
β”œβ”€β”€ backend/
β”‚ └── app/
β”‚ β”œβ”€β”€ main.py ← routes + CORS
β”‚ β”œβ”€β”€ models.py ← DB models
β”‚ β”œβ”€β”€ schemas.py ← Pydantic schemas
β”‚ β”œβ”€β”€ crud.py ← DB operations
β”‚ └── database.py ← SQLite setup
β”‚
└── frontend/
 └── src/
 β”œβ”€β”€ App.jsx
 β”œβ”€β”€ components/
 β”‚ β”œβ”€β”€ SnippetForm.jsx
 β”‚ β”œβ”€β”€ SnippetCard.jsx
 β”‚ └── SearchBar.jsx
 └── services/
 └── api.js

API

Method Endpoint Description
POST /snippets Create a snippet
GET /snippets Get all snippets
GET /snippets?search=xyz Search snippets
DELETE /snippets/{id} Delete a snippet

What's next

  • Edit snippets inline
  • JWT auth
  • Export to GitHub Gist
  • Browser extension

PRs are welcome. If you add something useful, open a PR and I'll review it.


Built by Ashish Yadav β€” drop a ⭐ if it was useful

About

πŸ—‚οΈ A full-stack developer tool to save, search, and reuse code snippets β€” built with FastAPI, React, and SQLite.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /