A powerful, collaborative code snippets management platform with real-time collaboration, drag-and-drop functionality, and intelligent syntax highlighting.
🌐 Live Demo: https://snippets-list.vercel.app
*Main dashboard with multiple snippet spaces*
- Visual Canvas: Freely moveable snippet boxes on a large interactive canvas
- Smart Code Detection: Automatic language detection and syntax highlighting
- File Operations: Drag & drop code files, edit, download, and change extensions
- Real-time Collaboration: Live editing with WebSocket connections
- Responsive Design: Complete functionality across desktop and mobile devices

Interactive canvas with moveable snippet boxes
- JWT-based authentication system
- Password encryption and secure user management
- Role-based access control (Admin, Editor, Viewer)
- Admin dashboard for user and content management
- Create and organize snippet collections in dedicated spaces
- Public/Private space visibility settings
- Collaborative workspaces with granular permissions
- Space ownership and admin controls
Space settings with collaborator management
- Color Coding: Customize snippet box colors and tag-based coloring
- Dark/Light Mode: Toggle between themes
- Expandable Modals: Resizable edit interfaces
- Smooth Animations: Framer Motion powered transitions
- Vibey UI: Modern, intuitive design language
Tag-based color coding and customization options
- Sidebar Navigation: Collapsible sidebar with full snippet overview
- Drag & Drop Reordering: Reorganize snippets through sidebar
- Tag System: Filter and organize snippets by tags
- Search Functionality: Find snippets by title quickly
- Click Navigation: Jump to specific snippets instantly
Collapsible sidebar with search, tags, and collaborators
- Real-time Editing: See changes as they happen
- Collaborator Management: Add/remove team members with specific roles
- WebSocket Status: Live connection monitoring
- Mobile Block Dragging: Special mobile-optimized controls
- Usage Analytics: Track recent views and activity
- Visual Data: Charts and graphs for usage patterns
- Performance Metrics: Understand your snippet usage
*Analytics section with visual data representation*
- Fully Responsive: Complete feature parity on mobile
- Touch Optimized: Mobile-specific drag controls
- Adaptive UI: Interface adjusts seamlessly to screen sizes
*Mobile-responsive design with touch controls*
- React + TypeScript for type-safe UI development
- dnd-kit for smooth drag-and-drop functionality
- Framer Motion for fluid animations and transitions
- TailwindCSS for responsive design and styling
- CodeMirror for advanced code syntax highlighting
- Lucide React for smooth icon animations
- Express.js + TypeScript for server-side logic
- WebSocket for real-time collaboration
- HTTP REST API for standard operations
- Zod for runtime type validation
- JWT for secure authentication
- Prisma ORM for database management
- Turbo Monorepo for organized codebase
- pnpm for efficient package management
- Frontend: Vercel for fast, global CDN delivery
- Backend: Render for reliable server hosting
├── snippets-frontend/ # React frontend application
│ ├── src/
│ ├── public/
│ └── package.json
│
└── snippets-backend/ # Turbo monorepo for backend
├── apps/
│ ├── api/ # Express HTTP server
│ └── ws/ # WebSocket server
├── packages/
│ ├── database/ # Prisma schema & migrations
│ ├── types/ # Shared TypeScript types
│ └── utils/ # Common utilities
└── turbo.json # Turbo configuration
- Node.js 18+
- pnpm 8+
- Database (PostgreSQL recommended)
The application consists of two separate repositories:
- Frontend: React application with TypeScript and TailwindCSS
- Backend: Express.js monorepo with Prisma database integration
Clone both repositories and follow their respective setup instructions to get started with development.
- Sign up and log into your dashboard
- Click "Create Space" to start a new snippet collection
- Choose between public or private visibility
- Start adding snippets to your canvas!
- Manual: Click "Add Snippet" in the header
- Drag & Drop: Drop code files directly onto the canvas
- Edit Mode: Click any snippet to edit code, description, or styling
- Open space settings from the sidebar
- Add collaborators by username
- Assign roles (Admin/Editor/Viewer)
- Share the space URL with your team
- Click on any collaborator to view their profile and public spaces
POST /signup- User registration with name, username, password, and optional admin rolePOST /signin- User login with username and password, returns JWT token and user dataPOST /signout- User logout (client-side token removal)POST /refresh-token- Refresh JWT token and get updated user information
GET /search/spaces- Search public spaces and snippets by query with pagination
GET /health- Health check endpoint returning service status and timestamp
GET /user/profile- Get current user profile or target user profile (admin only)PUT /user/profile- Update user profile information (admin can update any user)POST /user/metadata- Update user metadata (username, name)GET /user/metadata- Get user metadata with admin override capabilityGET /user/metadata/bulk- Get bulk user metadata (admin only)
PUT /user/password- Change user password (admin can change any user's password)
GET /user/spaces- Get user's owned spaces with paginationGET /user/spaces/collaborating- Get spaces where user is a collaboratorGET /user/snippets- Get user's snippets with pagination
GET /user/analytics/views- Get user's view analytics with date filteringGET /user/analytics/activity- Get user's recent activity and creation statistics
GET /user/profile/:username- Get public user profile by username (no auth required)GET /user/:userId/spaces/public- Get public spaces for a specific user (no auth required)
POST /space/- Create new space with name, description, and visibility settingsGET /space/all- Get all user spaces (admin sees all spaces, users see owned/collaborated)GET /space/public- Get all public spaces with paginationGET /space/:id- Get single space details with snippets and collaborator countPUT /space/:id- Update space information (admin/owner only)DELETE /space/:id- Delete space (owner or global admin only)
POST /space/:id/snippet- Create snippet in specific spaceGET /space/:id/snippets- Get all snippets in a spacePUT /space/:id/snippet/:snippetId- Update specific snippet in spaceDELETE /space/:id/snippet/:snippetId- Delete specific snippet from space
POST /space/:id/collaborators- Add collaborator to space with role assignmentGET /space/:id/collaborators- Get all space collaboratorsPUT /space/:id/collaborators/:userId- Update collaborator role (owner/admin only)DELETE /space/:id/collaborators/:userId- Remove collaborator from spaceGET /space/:id/collaborators/metadata- Get detailed collaborator information and statistics
PUT /space/:id/visibility- Change space visibility (public/private)PUT /space/:id/order- Update snippet ordering within space
GET /space/:id/analytics- Get space analytics with view statistics and date filteringGET /space/:id/views- Get space view history with pagination
GET /admin/users- List all users with pagination and statisticsPUT /admin/user/:userId- Update any user's profile and promote to adminDELETE /admin/user/:userId- Delete user and all associated data
GET /admin/spaces- List all spaces with owner information and statisticsPUT /admin/space/:spaceId- Update any space settingsDELETE /admin/space/:spaceId- Delete any space and associated data
GET /admin/snippet/:snippetId- Get snippet details with owner and space informationPUT /admin/snippet/:snippetId- Update any snippetDELETE /admin/snippet/:snippetId- Delete any snippet
GET /admin/map- Get system overview with user, space, and snippet counts plus recent activityGET /admin/analytics/views- Get comprehensive view analytics with date filteringGET /admin/analytics/popular- Get most popular snippets, spaces, and top users
WebSocket /ws/space/:spaceId- Establish WebSocket connection to specific space for real-time collaboration
The WebSocket server handles connections with the following features:
- Connection Validation: Validates space ID format and path structure
- Heartbeat Monitoring: Automatic ping/pong every 30 seconds with connection health checks
- Graceful Cleanup: Automatic cleanup of stale connections (60-second timeout)
- Connection Tracking: Server-side tracking of active connections with unique IDs
The app supports extensive theming through TailwindCSS with custom CSS variables:
@import "tailwindcss"
@custom-variant dark (&:where(.dark, .dark *));
@theme {
--color-background: #ffffff;
--color-surface: #f9fafb;
--color-text: #1f2937;
--color-text-secondary: #6b7280;
--color-border: #e5e7eb;
--color-primary: #3b82f6;
--color-success: #10b981;
}
/* Dark mode overrides */
@layer theme {
.dark {
--color-background: #1f2937;
--color-surface: #374151;
--color-text: #f9fafb;
--color-text-secondary: #d1d5db;
--color-border: #4b5563;
--color-primary: #60a5fa;
--color-success: #34d399;
}
}
@plugin 'tailwind-scrollbar';CodeMirror integration provides syntax highlighting for 50+ programming languages including JavaScript, Python, TypeScript, CSS, HTML, and many more popular languages.



