Docs/Getting Started/Project Structure

Project Structure

Learn how GoKS projects are organized and the specific purpose of each folder.

GoKS adheres to clear, opinionated fullstack standards modeled after modern web frameworks like Next.js, while retaining standard Go package conventions.

File Tree
text
myapp/
├── app/                  # File-system router
│   ├── layout.gox        # Root HTML layout and global SEO metadata
│   ├── page.gox          # Home route (/)
│   ├── not-found.gox     # Custom 404 page
│   ├── docs/             # Route /docs
│   │   └── page.gox
│   └── api/              # Backend REST API routes
│       └── todos/
│           └── route.go  # GET/POST /api/todos handler
├── components/           # Reusable GOX components
│   └── ui/               # Components generated via 'goks ui add'
├── models/               # ORM database models and schemas
├── public/               # Static assets (CSS, images, robots.txt, sitemap.xml)
├── go.mod                # Go module definition
└── .goks/                # Internal compilation cache (ignored in git)

Key Directories Explained

app/

Contains all file-based routes. Every folder with apage.goxrepresents a public URL path. Layouts (layout.gox) wrap children pages hierarchically.

app/api/

Hosts file-based REST API handlers. Aroute.gofile exports standard HTTP methods (GET,POST,PUT,DELETE). API routes are strictly server-side and never bundled into client WebAssembly.

components/

Shared, reusable UI components. Components created viagoks ui addare placed incomponents/ui/.

models/

Database model definitions used bypkg/orm. Defines table schemas, relations, hooks, and validations.

public/

Static files served directly by GoKS. Files placed here likerobots.txt,sitemap.xml, images, and fonts are served at the root or under/public/*.

Powered byGoKS WASM16 topics