Snippets Library logo

Snippets Library

Website

Code snippet manager with syntax highlighting and sharing

66 stars 6 forks last commit first released

Slowing down

No commits since 13 Sept 2025. Check the issue tracker before you rely on it.

Snippets Library screenshot

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:

Share:

Similar to Snippets Library

Dashwise

Customizable homelab dashboard for links, widgets and monitoring

445
22
Last commit

Dashwise is a self-hosted homelab dashboard built with Next.js and PocketBase. It offers GUI-managed links, modular widgets, link uptime checks, spotlight search and OIDC SSO.

GPL-3.0Actively maintained
Alternative to:
Dashy logo
Dashy
+9
ByteStash logo

ByteStash

Self-hosted web app for storing and organizing code snippets

2.5k
121
Last commit

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.

GPL-3.0Actively maintained
Alternative to:
SnippetsLab logo
SnippetsLab
+2

Chiyogami

Self-hosted pastebin with client-side encryption and REST API

80
4
Last commit

Modern pastebin offering client-side encryption, configurable expiry, user accounts, public search and a REST API. Built with Go, SQLite and TailwindCSS.

BSD-3-ClauseActively maintained
Alternative to:
Pastebin logo
Pastebin
+5
Opengist logo

Opengist

Self-hosted Git-backed pastebin and Gist-compatible code snippet manager

3.3k
186
Last commit

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/Helm deployment.

AGPL-3.0Actively maintained
Alternative to:
Pastebin logo
Pastebin
+6
Enclosed logo

Enclosed

Minimal app for sharing end-to-end encrypted notes and files

2.1k
183
Last commit

Self-hostable, end-to-end encrypted note and file sharing with zero-knowledge storage, optional passwords, expiration (TTL), and delete-after-reading links.

Apache-2.0Slowing down
Alternative to:
Privnote logo
Privnote
+13

nextExplorer

Self-hosted web file explorer with access control and previews

1k
27
Last commit

Modern, Docker-first self-hosted web file explorer with local users/groups, optional OIDC SSO, fast previews, built-in editor, sharing links, and search.

GPL-3.0Actively maintained
Alternative to:
Dropbox logo
Dropbox
+19