SnippetX is a web application that allows developers to save, organize, search, and manage code snippets. Built for speed, simplicity, and productivity — perfect for developers who want a lightweight alternative to Notion/Gists.
- Create, edit, delete code snippets
- Syntax highlighted editor
- Tags & categories for quick organization
- Pagination
- Search snippets instantly
- Dashboard with stats
- User authentication (Login/Signup/Logout)
- Frontend: React.js, TypeScript, TailwindCSS
- Backend: Node.js, NestJS
- Database: MongoDB
- Package Manager: pnpm
- Auth: JWT + Cookies
[React Frontend] → REST API → [Express Backend] → [MongoDB]
↓ ↓ ↓
UI Pages API Routes & Middleware Models & SchemaCore Flows:
- Auth Flow → JWT tokens stored in HTTP-only cookies
- Snippet Flow → Create → Save → Fetch → Render in editor
- Search Flow → MongoDB text index + frontend filtering
cd web
pnpm install
pnpm devcd server
pnpm install
pnpm start:devBackend .env example:
PORT=3000
MONGODB_URI=
JWT_SECRET=
HOSTS_URI="http://localhost:5173 http://localhost:5174"Frontend .env example:
VITE_API_BASE_URL="http://localhost:3000/api"POST /auth/register
POST /auth/login
POST /auth/logout
GET /users/profilePOST /snippets
GET /snippets
GET /snippets/stats
GET /snippets/:id
PUT /snippets/:id
DELETE /snippets/:id- Sign up using email and password
- Create your first snippet
- Tag it for easy filtering
- View stats on dashboard
- Search snippets using keywords
- Edit or delete when needed
Pull requests are welcome! If you’d like to contribute, feel free to fork the repo and submit a PR.
This project is open-source and available under the MIT License.








