Skip to content

AbhijyYdv547/CodeSnipVault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

112 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeSnipVault

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.


Features

  • 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

Tech Stack

Frontend

  • Next.js
  • Tailwind CSS
  • ShadCN
  • CodeMirror

Backend

  • Go (Chi)
  • PostgreSQL
  • JWT Authentication

Other

  • Docker & Docker Compose
  • Deployment: Vercel (frontend), Render/AWS (backend)

Project Structure

codesnipvault/
├── backend/          # Go backend (API + DB + Auth)
├── frontend/         # Next.js frontend
└── docker-compose.yml

Setup

1. Local Development Setup

Prerequisites

  • Go 1.24+
  • Node.js 18+
  • PostgreSQL
  • Docker (optional, for containerized setup)

Clone the Repository

git clone https://github.com/username/CodeSnipVault.git
cd CodeSnipVault

Backend Setup

cd 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 && ./api

Frontend Setup

cd frontend

mv .env.example .env

npm install

npm run dev

2. Docker Setup

docker-compose up --build


API Endpoints

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)

Screenshots

Landing Page

Login and Signup Pages

Snippet Dashboard

Snippet Generation Page

Snippet Updation

Snippet Share Page

User Profile Page


Roadmap

Completed

  • Frontend authentication pages
  • Hook auth pages to endpoints
  • Snippet dashboard
  • Snippet Editor
  • Hook dashboard and editor to endpoints
  • Public snippet sharing

Planned

  • Add unit tests
  • Add integration tests
  • Deployment with CI/CD

Contribution

Feel free to fork the repository, make improvements, or suggest features via pull requests.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors