Building a Private Code Snippet Manager with Syntax Highlighting

Every developer accumulates code snippets—Ansible playbooks, Terraform configs, shell scripts, quick Python utilities. Scattered across Gists, notes apps, and random text files, they’re never where you need them. Here’s how to build your own private snippet manager. Architecture Overview The solution is simple: FastAPI backend with JSON file storage Static HTML frontend with vanilla JavaScript Prism.js for syntax highlighting Hugo for deployment (optional, or serve directly) The Data Model 1 2 3 4 5 6 7 8 9 class FileCreate(BaseModel): filename: str content: str language: str = "" class FileUpdate(BaseModel): filename: Optional[str] = None content: Optional[str] = None language: Optional[str] = None Files belong to projects. Each file stores: ...

February 18, 2026 · 3 min · 510 words · Rob Washington