Project structure
Understand the few files you edit, the output Ridu generates, and what can stay out of your way.
Most work starts in content/.
Keep the development command running, edit a collection, and let Ridu refresh the contracts and admin. The rest of the project can stay out of your way until you need it.
The project at a glance
This uses the smallest interactive scaffold: choose Blank, SQLite, and no coding-agent guidance. You only need six places to understand the shape of the application.
content/Your content model
Collections, fields, access rules, hooks, and application plugin registration.
cmd/server/main.goRuntime wiring
The database adapter, embedded admin, server address, and production options.
admin/Admin entry
Mounts the admin and registers your static UI extensions.
generated/Generated contracts
The schema manifest, OpenAPI document, Go contracts, and typed TypeScript client.
ridu.tomlProject settings
Paths and adapter choices used by the CLI. Secrets and schema do not belong here.
migrations/Production changes
Reviewed, immutable database changes. This directory appears with your first migration.
Show the complete Blank + SQLite scaffold
my-ridu-app/
├── admin/
│ ├── src/
│ │ ├── main.ts
│ │ ├── plugins.ts
│ │ └── ridu.plugins.generated.ts
│ ├── index.html
│ ├── package.json
│ ├── tsconfig.json
│ └── vite.config.ts
├── cmd/
│ └── server/
│ └── main.go
├── content/
│ ├── config.go
│ ├── users.go
│ └── ridu_plugins.generated.go
├── generated/
│ ├── ridu.generated.go
│ ├── ridu.generated.ts
│ ├── ridu.openapi.json
│ └── ridu.schema.json
├── internal/
│ └── adminassets/
│ ├── dist/
│ │ └── placeholder.txt
│ └── assets.go
├── .gitignore
├── PROJECT.md
├── README.md
├── go.mod
├── go.sum
├── package.json
├── ridu.plugins.json
└── ridu.tomlDifferent scaffold choices
- Starter also adds
content/posts.go. - PostgreSQL and MongoDB add an adapter-specific
compose.yaml. - pnpm, Yarn, and agent choices add only their own workspace or guidance files.
Files created later
- Your package manager creates its lockfile during installation.
ridu devuses disposable.ridu/state.- Migrations and
dist/appear only when you create or build them.
Add a collection
A blank project starts with the authenticated userscollection. Create content/posts.go, then register it beside Users in the complete config.
package content
import (
"github.com/riducms/ridu"
"github.com/riducms/ridu/field"
)
var Posts = ridu.Collection{
Slug: "posts",
Access: ridu.CollectionAccess{
Create: authenticatedOnly,
Read: authenticatedOnly,
Update: authenticatedOnly,
Delete: authenticatedOnly,
},
Fields: []field.Definition{
field.Text("title", field.Required()),
},
}package content
import "github.com/riducms/ridu"
func Config() ridu.Config {
return ridu.Config{
Name: "Content",
Admin: ridu.AdminConfig{User: "users"},
Plugins: installedPlugins(),
Collections: []ridu.Collection{
Users,
Posts,
},
}
}Save both files while your package manager's devcommand is running. The admin reloads with a Posts collection, and the generated Go, OpenAPI, and TypeScript contracts all gain the same document shape.
What happens when you save
Change the Go configuration once, then development updates every surface that needs the new model.
You edit the model
content/*.goFields, access rules, hooks, and plugins live here.
Ridu resolves it
ridu devThe executable config becomes one deterministic manifest.
Every surface updates
generated/ + adminContracts, safe development storage, the API, and admin stay aligned.
Development synchronization is not a deployment plan. Create and review an immutablemigrationbefore shipping a production schema change.
Editing rules
Use these rules to decide what to edit, regenerate, or recreate.
Edit application code
content/, admin/src/plugins.tsDefine content behaviour and register admin extensions here.
Change project wiring
cmd/server/main.go, ridu.toml, package filesChange these when runtime composition, project paths, or dependencies change.
Regenerate, review, commit
generated/, plugin registries, migrations, lockfilesRegenerate these with the relevant command and review the diff. Do not edit derived files by hand.
Recreate freely
.ridu/, node_modules/, dist/These are local caches, installed dependencies, or build output—not source.
If generated output looks wrong
Change the Go source and regenerate. Patching generated JSON or TypeScript only hides the mismatch until the next ridu dev orridu generate run.