A full-stack blog application built with Go (GraphQL backend) and SvelteKit (frontend), managed as a monorepo with Turborepo.
Backend (Go)
- GraphQL API with gqlgen
- PostgreSQL database
- Echo web framework
- SQLC for type-safe SQL queries
- Database migrations with golang-migrate
Frontend (SvelteKit)
- SvelteKit 5 with TypeScript
- Apollo Client for GraphQL
- Tailwind CSS (Shopify-inspired design)
- Shared UI component library
Monorepo Tools
- Turborepo for build orchestration
- pnpm/yarn for package management
.
├── apps/
│ └── web/ # SvelteKit frontend application
├── services/
│ └── core/ # Go GraphQL backend service
├── packages/
│ ├── ui/ # Shared Svelte component library
│ ├── eslint-config/ # Shared ESLint configuration
│ └── typescript-config/ # Shared TypeScript configuration
└── docker-compose.yml # Local development database
- Node.js >= 20
- Go >= 1.24
- Docker & Docker Compose (for PostgreSQL)
- pnpm or yarn
- Clone and install
git clone https://github.com/smithg09/sveltekit-go-graphql-starter.git
cd sveltekit-go-graphql-starter
make setup
# OR manually:
# yarn install
# make db-up
# cd services/core && cp .env.example .env
# make migrate-up- Start development
make dev
# OR
# make dev-backend (backend only)
# make dev-frontend (frontend only)- Setup git hooks (first time only)
yarn prepareNow all commits will be automatically linted and formatted!
The application will be available at:
- Frontend: http://localhost:5173
- Backend GraphQL Playground: http://localhost:8080
See services/core/README.md for detailed backend documentation.
Common commands:
# From root directory
make dev-backend # Start backend with hot reload
make gqlgen # Generate GraphQL code
make sqlc # Generate SQLC queries
make test-backend # Run tests with coverage
make migrate-up # Run migrations
make migrate-down # Rollback migration
# Generate mocks with options
make name=PostRepository mock
make name=PostRepository filename=mock_post.go mockCommon commands:
cd apps/web
# Development server
yarn dev
# Build for production
yarn build
# Type checking
yarn check-types
# Linting
yarn lintShared Svelte components used across applications.
cd packages/ui
# Watch mode during development
yarn dev
# Build library
yarn build- ✅ CRUD operations for blog posts and categories
- ✅ GraphQL API with type-safe queries
- ✅ Database migrations
- ✅ Form validation
- ✅ Toast notifications
- ✅ Responsive UI with Tailwind CSS
- ✅ Pagination and filtering
- ✅ Modal dialogs
- ✅ Status badges
- ✅ Pre-commit hooks for code quality
- ✅ Conventional commit enforcement
- GraphQL over REST: Flexible data fetching, strong typing
- SQLC: Type-safe SQL queries without ORM overhead
- Echo: Lightweight, high-performance HTTP framework
- Database migrations: Version-controlled schema changes
- SvelteKit: Modern framework with excellent DX
- Apollo Client: Robust GraphQL client with caching
- Monorepo UI package: Reusable components across apps
- Tailwind CSS: Utility-first styling
# Backend tests
cd services/core
go test ./...
# Frontend tests (if configured)
cd apps/web
yarn testcd services/core
make build-backend
# Binary available at build/corecd apps/web
yarn build
# Output in .svelte-kit/outputBackend (Go service):
docker build -t golang-sveltekit-core:latest -f services/core/Dockerfile services/core/Frontend (SvelteKit app):
docker build -t golang-sveltekit-web:latest -f apps/web/Dockerfile .Make sure to configure environment variables while running the images
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using conventional commits (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
MIT License - see LICENSE file for details