CodeSnipVault is a web application for managing and sharing code snippets. Users can log in, create and organize their snippets by language and type, and optionally share them through unique public links.
- User authentication with JWT
- Create, edit, and delete code snippets
- Filter snippets by language, tags, or search string
- Share snippets via unique URLs (public/private toggle)
- Code editor using CodeMirror
- Dashboard with search and filter options
- Next.js
- Tailwind CSS
- ShadCN
- CodeMirror
- Go (Chi)
- PostgreSQL
- JWT Authentication
- Docker & Docker Compose
- Deployment: Vercel (frontend), Render/AWS (backend)
codesnipvault/
├── backend/ # Go backend (API + DB + Auth)
├── frontend/ # Next.js frontend
└── docker-compose.yml
- Go 1.24+
- Node.js 18+
- PostgreSQL
- Docker (optional, for containerized setup)
git clone https://github.com/username/CodeSnipVault.git
cd CodeSnipVaultcd backend
mv .env.example .env
go mod tidy
cd sql/schema
goose postgres POSTGRES_CONNECTION_STRING up
cd ../..
sqlc generate
cd cmd/api
go build && ./apicd frontend
mv .env.example .env
npm install
npm run devdocker-compose up --build| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/auth/signup |
Register a new user |
| POST | /v1/auth/login |
Login an existing user |
| POST | /v1/auth/logout |
Logout the current user (requires auth) |
| POST | /v1/snippets/create |
Create a new snippet (requires auth) |
| GET | /v1/snippets/ |
Get all snippets for the user (requires auth) |
| GET | /v1/snippets/{id} |
Get a specific snippet (requires auth) |
| PUT | /v1/snippets/{id} |
Update a specific snippet (requires auth) |
| DELETE | /v1/snippets/{id} |
Delete a specific snippet (requires auth) |
| GET | /v1/snippets/share/{share_id} |
View a public/shared snippet (no auth) |
| GET | /v1/user/profile |
Get user profile details (requires auth) |
| PUT | /v1/user/update |
Update user profile (requires auth) |
- Frontend authentication pages
- Hook auth pages to endpoints
- Snippet dashboard
- Snippet Editor
- Hook dashboard and editor to endpoints
- Public snippet sharing
- Add unit tests
- Add integration tests
- Deployment with CI/CD
Feel free to fork the repository, make improvements, or suggest features via pull requests.