A modern web application for sharing and managing code snippets, built with Go and Vue.js.
.
├── frontend/ # Vue.js frontend application
│ ├── src/ # Source files
│ │ ├── components/ # Vue components
│ │ ├── stores/ # Pinia stores
│ │ ├── views/ # Page components
│ │ └── ...
│ ├── dist/ # Built frontend files
│ └── ...
├── internal/ # Backend application
│ ├── api/ # HTTP handlers
│ ├── models/ # Data models
│ ├── server/ # Server setup and routing
│ └── storage/ # Storage interfaces and implementations
├── data/ # Database migrations and seeds
├── yaak/ # Yaak configuration files
└── main.go # Application entry point
- User authentication and authorization
- Share code snippets with others
- Like and unlike snippets with real-time updates
- Modern, responsive UI with loading states
- RESTful API with proper error handling
- Client-side caching with TanStack Query
- Secure API responses that protect user data
- Form validation with Zod and VeeValidate
- Toast notifications with Vue Sonner
- Database integration with SQLC
POST /api/auth/login
- User loginPOST /api/auth/signup
- User registrationPOST /api/auth/logout
- User logoutPOST /api/auth/refresh
- Refresh access tokenGET /api/auth/me
- Get current user
GET /api/snippets
- Get all snippetsGET /api/snippets/{id}
- Get a specific snippetPOST /api/snippets
- Create a new snippetPUT /api/snippets/{id}
- Update a snippetDELETE /api/snippets/{id}
- Delete a snippetPATCH /api/snippets/{id}/like?action=like|unlike
- Like or unlike a snippet
- Go 1.24 or later
- Node.js 22.x or later
- pnpm (recommended) or npm
- Docker and Docker Compose (optional)
-
Install Go dependencies:
go mod download
-
Run the server:
# Using Air for hot reload air # Or directly go run main.go
-
Install dependencies:
cd frontend pnpm install
-
Start development server:
pnpm dev
-
Build for production:
pnpm build
The backend follows a clean architecture pattern:
- Models: Data structures and validation
- Storage: Data persistence interface and implementations
- API: HTTP handlers and request/response handling
- Server: Routing and middleware setup
- Database: PostgreSQL with SQLC for type-safe queries
The frontend is built with Vue.js and uses:
- Vue 3 with Composition API
- TypeScript for type safety
- Vite for build tooling
- Tailwind CSS for styling
- Pinia for state management
- TanStack Query for data fetching
- VeeValidate with Zod for form validation
- Go
- SQLite
- SQLC
- Air (for live reload)
- Docker
- Vue 3
- TypeScript
- Vite
- Tailwind CSS
- Pinia
- TanStack Query
- Zod
- Add database integration
- Add user authentication
- Add syntax highlighting
- Possibility to bookmark snippets
- Add user profiles
Optional:
- Add snippet categories/tags
- Add search functionality
- Add comments on snippets
This project is licensed under the MIT License - see the LICENSE file for details.