A modern code snippet sharing platform built with Go and Vue.js. Features include user authentication, syntax highlighting, and a responsive UI. https://codeshare.mitsimi.dev
  • Go 40.5%
  • Vue 37.7%
  • TypeScript 18.4%
  • CSS 2.9%
  • Dockerfile 0.3%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-01 16:37:32 +02:00
.github/workflows refactor: modernize 2026-02-12 16:56:37 +01:00
.zed Update zed settings 2026-02-20 13:47:58 +01:00
frontend chore(langs): fetch latest language definitions 2026-08-01 16:37:32 +02:00
internal refactor: modernize 2026-02-12 16:56:37 +01:00
yaak refresh token request 2025-06-19 10:48:02 +02:00
.air.toml feat: add dev build mode with conditional frontend embedding 2026-02-05 15:42:20 +01:00
.gitignore exclude data 2025-05-26 16:21:34 +02:00
docker-compose.yml prep for seperate deployment 2025-05-31 22:12:25 +02:00
Dockerfile Merge branch 'dependabot/docker/node-25-alpine' 2025-12-01 22:15:27 +01:00
go.mod Bump Go toolchain to 1.26 2026-02-20 00:32:41 +01:00
go.sum chore: update dependencies 2026-02-01 18:15:39 +01:00
LICENSE refactor backend 2025-05-19 16:52:28 +02:00
main.go feat(server): refactor repository dependencies 2025-06-28 15:07:39 +02:00
README.md docs: improved readme 2025-12-13 00:31:17 +01:00
sqlc.yaml split queries up 2025-06-03 12:42:05 +02:00
TECHNICAL.md docs: improved readme 2025-12-13 00:31:17 +01:00

Code Share

A fullstack code snippet platform built as an engineeringfocused project to explore backend architecture, authentication, and frontend state management beyond typical course requirements.

This project was originally developed for a university course and later expanded and refined to experiment with clean architecture, typesafe database access, and modern frontend patterns.

Why this project exists

Instead of building a minimal app to satisfy the course, I intentionally overshot the scope to treat it as a realistic system:

  • nontrivial authentication and session handling
  • clear separation between domain logic and transport
  • type safety across the database, backend, and frontend
  • real clientside state management and caching

The goal was not to “ship a product”, but to practice designing and reasoning about a system that stays understandable as it grows.

Highlevel overview

  • Backend: Go REST API following a clean architecture approach
  • Frontend: Vue 3 + TypeScript SPA with modern state and datafetching patterns
  • Database: SQLite with SQLC for compiletime checked queries
  • Auth: JWT access tokens with refresh tokens and serverside session tracking

Backend architecture

The backend is structured into explicit layers:

  • Domain
    Core business entities and rules, independent of HTTP or storage.

  • Repositories
    Interfaces and implementations for persistence, isolating database concerns.

  • API / Handlers
    Thin HTTP layer responsible for request validation, authentication, and response mapping.

  • Infrastructure
    Routing, middleware, logging, and database connections.

Key design decisions:

  • Used SQLC to eliminate an entire class of runtime SQL errors.
  • Kept handlers small to prevent business logic from leaking into HTTP code.
  • Explicit error types mapped consistently to HTTP responses.

Frontend architecture

  • Vue 3 Composition API with strict TypeScript usage
  • TanStack Query for server state and caching
  • Pinia only for true clientside state
  • Form validation via Zod schemas, integrated with VeeValidate

The focus was on predictable data flow and minimizing implicit or duplicated state.

Technical challenges explored

Some problems I deliberately spent time on:

  • Designing authentication flows with refresh tokens and session invalidation
  • Maintaining type safety from database queries to frontend components
  • Avoiding tight coupling between API responses and UI state
  • Structuring the project so new features do not require touching unrelated code

What I would improve next

If I were to continue working on this project:

  • Add integration and propertybased tests for critical backend paths
  • Introduce explicit database migrations instead of schema initialization
  • Implement ratelimiting and more granular authorization rules
  • Expand realtime features beyond simple like/save interactions

Tech stack

Backend

  • Go
  • Chi router
  • SQLite + SQLC
  • JWT, bcrypt
  • Zap logging

Frontend

  • Vue 3 + TypeScript
  • Vite
  • Tailwind CSS
  • TanStack Query
  • Pinia

Running the project locally

# backend
go mod download
go run .

# frontend
cd frontend
pnpm install
pnpm dev

During development, the backend proxies requests to the frontend, so the application is accessible via:

http://localhost:8080

Project status

The project fully meets and exceeds the original course requirements and serves as a longterm playground for experimenting with architectural ideas and incremental improvements.

While it is not developed against a fixed roadmap, I occasionally extend and refine it (e.g. improving language support and syntax highlighting) when exploring new ideas or techniques.