
Snippets Library
Code snippet manager with syntax highlighting and sharing

Snippets Library is a full-stack code snippet manager for storing, organizing, and sharing code with high-quality syntax highlighting and search. It provides authenticated snippet storage, public share links with view/like tracking, per-user settings, and a RESTful API surface for snippet management.
Key Features
- Create, edit, delete and organize code snippets with metadata (title, description, language, tags).
- Server-side syntax highlighting using Shiki with a cached highlighting service and fallback language detection.
- Public share links implemented via secure random share IDs with view counting, like/unlike and copy-as-new-snippet actions.
- Per-user bookmarks, likes, and persistent user settings stored in a JSONB settings object.
- Authentication via NextAuth (GitHub provider) with a Drizzle adapter; sessions stored in the database.
- Postgres-backed schema using Drizzle ORM; includes snippet views, likes, bookmarks and user tables plus migration scripts.
- Instant search, pagination, language filtering and tag-based queries on the snippets API.
- Utility endpoints for language detection, health checks and user settings.
Use Cases
- Maintain a personal searchable library of commonly used code snippets and templates.
- Share public examples or utilities with teammates using secure share links and track engagement.
- Seed a developer blog or documentation with copyable, highlighted snippets and preserve authorship and metadata.
Limitations and Considerations
- Default authentication is configured for GitHub OAuth; additional providers require custom NextAuth configuration.
- Requires a PostgreSQL database and appropriate environment variables; migrations are managed via drizzle-kit.
- Shiki-based server-side highlighting can increase memory/CPU usage at scale and may require caching/worker tuning.
- The repository snapshot contains no bundled unit tests; testing must be added if required by deployments.
Snippets Library is suited for developers and teams who need a lightweight, self-hosted snippet manager with high-quality highlighting and sharing features. It is configurable for production deployments but requires standard Node/Postgres infrastructure and OAuth credentials to enable authentication.
Categories:
Tags:
Tech Stack:
Similar Services

asciinema
Command-line terminal session recorder and web player
Open-source CLI for recording, replaying and live-streaming terminal sessions using lightweight asciicast files and an embeddable web player.

PrivateBin
Zero-knowledge encrypted pastebin with browser-side AES encryption
PrivateBin is a minimalist zero-knowledge pastebin that encrypts and decrypts pastes in the browser, with optional passwords, expiration, discussions, and file uploads.
MicroBin
Secure pastebin for text and file sharing with URL shortening
MicroBin is a lightweight, secure pastebin for sharing text, files, and short URLs with optional encryption, expiration controls, and raw file serving.

Opengist
Self-hosted Git-backed pastebin and Gist-compatible code snippet manager
Self-hosted pastebin powered by Git. Create, share and manage public, unlisted or private code snippets with syntax highlighting, Git push/pull, OAuth logins and Docker/H...

Onetime Secret
Self-destructing service for sharing single-use encrypted secrets
Open-source web and API service to create encrypted, single-view links for sharing secrets with configurable expiry and optional passphrase protection.


ByteStash
Self-hosted web app for storing and organizing code snippets
ByteStash is a self-hosted snippet manager for creating, editing, and filtering code snippets with secure storage in SQLite and an optional API with Swagger UI.
Docker
TypeScript
React
Node.js
Tailwind CSS