Project Structure
Project Structure
Monorepo Architecture (Workspaces + Turborepo)
When configuring decoupled frontend and backend services, Koko structures a clean monorepo powered by pnpm workspaces and Turborepo for high-speed parallel builds:
my-project/
— Root monorepo workspace directory
apps/
— Executable applications and services
web/
— Frontend application (Next.js, React, etc.)
api/
— Backend API server (Express, Go Chi, FastAPI, etc.)
packages/
— Shared packages and configurations
db/
— Shared database client and ORM schemas
tsconfig/
— Shared base TypeScript configurations
docker-compose.yml
— Local database and container services setup
koko.config.json
— Koko workspace configuration manifest
package.json
— Root configuration defining workspace packages
pnpm-workspace.yaml
— pnpm package definitions
turbo.json
— Turborepo build pipeline and cache rules
README.md
— Project documentation and quickstart commands
Standalone Layout: SaaS Starter (Next.js)
For the SaaS Starter recipe (Next.js App Router + Drizzle + Better-Auth), Koko structures a scalable fullstack architecture:
my-saas/
— SaaS project root directory
src/
— Application source code
app/
— Next.js App Router pages and Server Actions
api/
— Auth endpoints and payment webhooks
page.tsx
— Main landing page
layout.tsx
— Root layout with theme and auth providers
components/
— UI component library (shadcn UI / Tailwind)
lib/
— Utilities, auth client, and database connection
db/
— Drizzle schema definitions and SQL migrations
docker-compose.yml
— Local PostgreSQL container
koko.config.json
— Koko configuration manifest
next.config.mjs
— Next.js compiler configuration
Backend Layout: Go Chi Router
For Go-powered backends, Koko enforces standard Golang project layout conventions:
api-go/
— Go server root folder
cmd/
— Executable build entrypoints
api/
main.go
— Chi router bootstrap and server startup
pkg/
— Application modules and business logic
handlers/
— HTTP route handlers
db/
— Database client connection and GORM models
go.mod
— Go module dependencies manifest
go.sum
— Go module checksums file