Docs / Project layout
Project layout
What a scaffolded Hopak app looks like on disk.
hopak new my-app produces this tree. Everything else (CRUD routes, migrations, dev certs) is generated on demand with hopak generate / hopak migrate.
my-app/
├── app/
│ ├── models/
│ │ └── post.ts # sample model
│ └── routes/
│ ├── index.ts # GET /
│ └── api/
│ ├── posts.ts # GET + POST /api/posts
│ └── posts/[id].ts # GET/PUT/PATCH/DELETE /api/posts/:id
├── public/ # static files (served at /)
├── .env.example # copied to .env for secrets
├── .gitignore
├── hopak.config.ts # server + database config
├── main.ts # entry: `await hopak().listen()`
├── package.json
├── README.md
└── tsconfig.json
Directories added on demand by the CLI:
app/migrations/— created byhopak migrate init/newapp/middleware/— convention only, not auto-loaded. Put shared middleware modules here and import them explicitly frommain.ts(for global) or individual route files (for local)..hopak/— runtime cache (SQLite data file, dev TLS certs); gitignored