A full-stack blog application built with Go (GraphQL backend) and SvelteKit (frontend), managed as a monorepo with Turborepo.
Backend (Go)
Frontend (SvelteKit)
Monorepo Tools
.
├── 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
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
make dev
# OR
# make dev-backend (backend only)
# make dev-frontend (frontend only)
yarn prepare
Now all commits will be automatically linted and formatted!
The application will be available at:
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 mock
Common commands:
cd apps/web
# Development server
yarn dev
# Build for production
yarn build
# Type checking
yarn check-types
# Linting
yarn lint
Shared Svelte components used across applications.
cd packages/ui
# Watch mode during development
yarn dev
# Build library
yarn build
# Backend tests
cd services/core
go test ./...
# Frontend tests (if configured)
cd apps/web
yarn test
cd services/core
make build-backend
# Binary available at build/core
cd apps/web
yarn build
# Output in .svelte-kit/output
Backend (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
git checkout -b feature/amazing-feature)git commit -m 'feat: add amazing feature')git push origin feature/amazing-feature)See CONTRIBUTING.md for detailed guidelines.
MIT License - see LICENSE file for details