bunigniter 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +229 -0
  3. package/dist/LICENSE +21 -0
  4. package/dist/README.md +229 -0
  5. package/dist/base/controller.ts +324 -0
  6. package/dist/base/index.ts +5 -0
  7. package/dist/base/service.ts +21 -0
  8. package/dist/cli/index.ts +318 -0
  9. package/dist/cli/list-routes.ts +72 -0
  10. package/dist/cli/repl.ts +461 -0
  11. package/dist/cli/templates.ts +283 -0
  12. package/dist/client/index.ts +159 -0
  13. package/dist/db/drizzle.ts +550 -0
  14. package/dist/db/validators.ts +229 -0
  15. package/dist/edge-builder.ts +120 -0
  16. package/dist/edge.ts +69 -0
  17. package/dist/helpers/cache.ts +173 -0
  18. package/dist/helpers/cors.ts +103 -0
  19. package/dist/helpers/csrf.ts +155 -0
  20. package/dist/helpers/debug.ts +158 -0
  21. package/dist/helpers/env.ts +147 -0
  22. package/dist/helpers/handler.ts +158 -0
  23. package/dist/helpers/http.ts +194 -0
  24. package/dist/helpers/image.ts +217 -0
  25. package/dist/helpers/jwt.ts +147 -0
  26. package/dist/helpers/logger.ts +96 -0
  27. package/dist/helpers/mail.ts +272 -0
  28. package/dist/helpers/middleware-loader.ts +116 -0
  29. package/dist/helpers/middleware.ts +57 -0
  30. package/dist/helpers/modules.ts +115 -0
  31. package/dist/helpers/openapi.ts +140 -0
  32. package/dist/helpers/pagination.ts +159 -0
  33. package/dist/helpers/queue.ts +186 -0
  34. package/dist/helpers/request-context.ts +13 -0
  35. package/dist/helpers/request.ts +376 -0
  36. package/dist/helpers/schedule.ts +173 -0
  37. package/dist/helpers/session-middleware.ts +89 -0
  38. package/dist/helpers/session.ts +286 -0
  39. package/dist/helpers/sse.ts +90 -0
  40. package/dist/helpers/throttle.ts +156 -0
  41. package/dist/helpers/upload.ts +417 -0
  42. package/dist/helpers/validator.ts +287 -0
  43. package/dist/helpers/ws.ts +123 -0
  44. package/dist/index.ts +221 -0
  45. package/dist/package.json +70 -0
  46. package/dist/router/file-router.ts +541 -0
  47. package/dist/router/server-router.ts +103 -0
  48. package/dist/view/page.ts +96 -0
  49. package/dist/view/renderer.tsx +390 -0
  50. package/dist/view/view-response.ts +10 -0
  51. package/package.json +70 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NexusTS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,229 @@
1
+ # Bunigniter
2
+
3
+ **Bun-native fullstack framework — CodeIgniter spirit × Elysia v2 performance × Edge-ready**
4
+
5
+ ```bash
6
+ bun run examples/todo-app/dev.ts # Todo app (React SSR) :3000
7
+ bun run examples/hn-app/dev.ts # Hacker News clone :3000
8
+ bun run examples/petstore/dev.ts # Pet Store + cart :3000
9
+ bun run examples/blog-app-html/dev.ts # Blog CMS (Rendu) :3001
10
+ bun run examples/blog-app-tsx/dev.ts # Blog CMS (React SSR) :3002
11
+ ```
12
+
13
+ ---
14
+
15
+ ## Why Bunigniter?
16
+
17
+ PHP developers (CodeIgniter, Laravel) moving to TypeScript face a wall: NestJS is over-engineered, Hono is too bare, AdonisJS is Node-only. **Bunigniter is the bridge.**
18
+
19
+ ```ts
20
+ // routes/users.ts — file path = URL
21
+ import { Controller } from 'bunigniter'
22
+
23
+ export class Users extends Controller {
24
+ async index() {
25
+ return this.json(await this.db.get('users'))
26
+ }
27
+ async show(id: number) {
28
+ const user = await this.db.first('SELECT * FROM users WHERE id = ?', [id])
29
+ if (!user) return this.notFound()
30
+ return this.json(user)
31
+ }
32
+ async create() {
33
+ const data = this.request.only(['name', 'email'])
34
+ const v = this.validate(data, { name: 'required|min:2', email: 'required|email' })
35
+ if (v.fails()) return this.badRequest(v.errors)
36
+ await this.db.insert('users', { name: v.data.name, email: v.data.email })
37
+ return this.json({ ok: true }, 201)
38
+ }
39
+ }
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ git clone https://github.com/nexus-ts/bunigniter.git
48
+ cd framework
49
+ bun install
50
+ bun run examples/todo-app/db/seed.ts
51
+ bun run examples/todo-app/dev.ts
52
+ # → http://localhost:3000
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Features
58
+
59
+ | Category | Features |
60
+ |----------|----------|
61
+ | **Core** | Controller, Service, DI, File-based routing, Void-style routing, HMVC modules |
62
+ | **Database** | SQLite/PostgreSQL/MySQL/D1, CI-style query builder, `db.get/insert/update/delete`, JOIN, pagination, transactions, multi-database |
63
+ | **Templates** | Rendu (PHP-style `<?= ?>`), MDX (Markdown + JSX), React SSR, Inertia protocol, auto-layouts, partial includes, named slots |
64
+ | **Auth** | Session-based auth, JWT (sign/verify/middleware), CSRF, CORS |
65
+ | **API** | OpenAPI 3.1 auto-spec, Scalar UI, `OpenAPIRegistry` for custom docs |
66
+ | **CLI** | 27 artisan-style commands (`make:*`, `db:*`, `key:generate`, `storage:link`), REPL console, Route list |
67
+ | **Realtime** | WebSocket (`ws.handle`, rooms, broadcast), SSE (`sse(ctx, send)`), Scheduler (cron) |
68
+ | **Middleware** | Logger, Rate limiter, CORS, CSRF, Timing, Auth |
69
+ | **Services** | Cache (TTL), Queue (in-memory, retry), Upload (validation), Mail (SMTP/File/Null), Image manipulation, HTTP client |
70
+ | **Security** | CSRF tokens, Rate limiting, JWT, Session encryption (AES-256-GCM + HMAC) |
71
+ | **Edge** | Cloudflare Workers, Deno, pre-built routes (`bi build:edge`) |
72
+ | **Debug** | Debug toolbar with SQL profiling, session viewer, request headers, timing |
73
+
74
+ ---
75
+
76
+ ## Feature Comparison
77
+
78
+ | Capability | Bunigniter | NestJS | AdonisJS | Hono |
79
+ |------------|:-------:|:------:|:--------:|:----:|
80
+ | Bun-native runtime | ✅ | ❌ | △ | ✅ |
81
+ | Cloudflare Workers | ✅ | △ | ❌ | ✅ |
82
+ | Class-based controllers (extends Controller) | ✅ | ✅ | ✅ | ❌ |
83
+ | File-path routing (no decorators needed) | ✅ | ❌ | ❌ | ✅ |
84
+ | PHP-style templates | ✅ | ❌ | △ | ❌ |
85
+ | CI-style query builder | ✅ | ❌ | ✅ | ❌ |
86
+ | JWT auth | ✅ | ✅ | ✅ | ❌ |
87
+ | WebSocket | ✅ | ✅ | ❌ | ✅ |
88
+ | SSE | ✅ | ❌ | ❌ | ✅ |
89
+ | HMVC modules | ✅ | ✅ | ❌ | ❌ |
90
+ | Multi-database | ✅ | ✅ | ✅ | ❌ |
91
+ | OpenAPI auto-docs | ✅ | ✅ | ❌ | ✅ |
92
+ | 27 CLI commands | ✅ | ✅ | ✅ | ❌ |
93
+ | REPL console | ✅ | ✅ | ✅ | ❌ |
94
+ | Debug toolbar | ✅ | ❌ | ❌ | ❌ |
95
+ | 19 bundle entry points | ✅ | ❌ | ❌ | ✅ |
96
+ | No build step required (Bun native) | ✅ | ❌ | ❌ | ✅ |
97
+ | Field injection | ✅ | ❌ | ❌ | ❌ |
98
+
99
+ ---
100
+
101
+ ## Architecture
102
+
103
+ ```
104
+ routes/ ← Controllers & API handlers
105
+ users.ts ← CRUD controller
106
+ sse.ts ← Server-Sent Events
107
+ ws.ts ← WebSocket handlers
108
+ schedule.ts ← Cron tasks
109
+
110
+ views/ ← Templates
111
+ _layout.html ← Auto-layout (wraps all pages)
112
+ welcome.html ← Rendu (PHP-style <?= ?>)
113
+ About.mdx ← MDX (Markdown + variables)
114
+ TodoList.tsx ← React SSR component
115
+
116
+ modules/ ← HMVC modules (optional)
117
+ blog/routes/ ← /blog/*
118
+ shop/routes/ ← /shop/*
119
+ admin/routes/ ← /admin/*
120
+
121
+ config/app.ts ← Single config file
122
+ db/seed.ts ← Database seeder
123
+ ```
124
+
125
+ ---
126
+
127
+ ## CLI Reference (27 commands)
128
+
129
+ ```bash
130
+ bun run bi # Show help
131
+ bun run bi list # List all routes
132
+ bun run bi repl # Interactive console
133
+ bun run bi make:controller # Scaffold controller
134
+ bun run bi make:model # Scaffold DB schema
135
+ bun run bi make:migration # Create migration
136
+ bun run bi db:migrate # Run migrations
137
+ bun run bi db:seed # Run seeders
138
+ bun run bi db:rollback # Rollback migration
139
+ bun run bi db:wipe # Drop all tables
140
+ bun run bi make:seeder # Scaffold seeder
141
+ bun run bi make:middleware # Scaffold middleware
142
+ bun run bi make:command # Scaffold CLI command
143
+ bun run bi make:test # Scaffold test
144
+ bun run bi make:event # Scaffold event class
145
+ bun run bi make:job # Scaffold queue job
146
+ bun run bi make:mail # Scaffold mail class
147
+ bun run bi make:listener # Scaffold event listener
148
+ bun run bi make:provider # Scaffold service provider
149
+ bun run bi make:policy # Scaffold policy
150
+ bun run bi make:request # Scaffold form request
151
+ bun run bi make:resource # Scaffold API resource
152
+ bun run bi make:rule # Scaffold validation rule
153
+ bun run bi key:generate # Generate APP_KEY
154
+ bun run bi storage:link # Create storage symlink
155
+ bun run bi build:edge # Build edge routes
156
+ bun run bi edge:dev # Run edge app locally
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Database
162
+
163
+ CodeIgniter-style query builder with 11 helper methods:
164
+
165
+ ```ts
166
+ await db.insert('users', { name: 'Alice', email: 'a@b.com' })
167
+ await db.update('users', { name: 'Bob' }, { id: 1 })
168
+ await db.delete('users', { id: 1 })
169
+ await db.get('users', { role: 'admin' }, { orderBy: 'name', limit: 10 })
170
+ await db.getJoin('posts p', [['users u', 'u.id = p.user_id']], { where: { published: 1 } })
171
+ await db.count('users', { role: 'admin' })
172
+ await db.paginate('SELECT * FROM users', [], { page: 2, perPage: 20 })
173
+ await db.first('SELECT * FROM users WHERE id = ?', [1])
174
+ await db.sql\`SELECT * FROM users WHERE id = ${id}\`
175
+ await db.transaction(async (tx) => { ... })
176
+ ```
177
+
178
+ Supports SQLite, PostgreSQL, MySQL, Cloudflare D1. WHERE operators: `=`, `>`, `<`, `>=`, `<=`, `<>`, `LIKE`, `IN`.
179
+
180
+ ---
181
+
182
+ ## Templates (3 Engines)
183
+
184
+ | Engine | File | Syntax | Example |
185
+ |--------|------|--------|---------|
186
+ | **Rendu** | `.html` | `<?= title ?>` | PHP-style |
187
+ | **MDX** | `.mdx` | `{{ title }}` + Markdown | Documentation pages |
188
+ | **React SSR** | `.tsx` | `{title}` (JSX) | Full component control |
189
+
190
+ Auto-layout: `views/_layout.html` wraps all pages automatically. Named slots: `<?= slot_sidebar ?? '' ?>`.
191
+
192
+ ---
193
+
194
+ ## Documentation
195
+
196
+ | Guide | File |
197
+ |-------|------|
198
+ | Controller Lifecycle | [docs/user-guide/controller-lifecycle.md](docs/user-guide/controller-lifecycle.md) |
199
+ | Request Input | [docs/user-guide/request.md](docs/user-guide/request.md) |
200
+ | Template Engine | [docs/user-guide/template-engine.md](docs/user-guide/template-engine.md) |
201
+ | Database | [docs/user-guide/database.md](docs/user-guide/database.md) |
202
+ | Multi-Database | [docs/user-guide/multi-database.md](docs/user-guide/multi-database.md) |
203
+ | HMVC Modules | [docs/user-guide/hmvc-modules.md](docs/user-guide/hmvc-modules.md) |
204
+ | OpenAPI | [docs/user-guide/openapi.md](docs/user-guide/openapi.md) |
205
+ | JWT Auth | [docs/user-guide/jwt-auth.md](docs/user-guide/jwt-auth.md) |
206
+ | WebSocket | [docs/user-guide/websocket.md](docs/user-guide/websocket.md) |
207
+ | SSE | [docs/user-guide/sse.md](docs/user-guide/sse.md) |
208
+ | CLI Reference | [docs/user-guide/cli-reference.md](docs/user-guide/cli-reference.md) |
209
+ | Helpers Reference | [docs/user-guide/helpers.md](docs/user-guide/helpers.md) |
210
+
211
+ ---
212
+
213
+ ## Example Apps
214
+
215
+ | App | Stack | Port | Features |
216
+ |-----|-------|:----:|----------|
217
+ | [Todo App](examples/todo-app) | React SSR | 3000 | CRUD, filters, search |
218
+ | [Hacker News](examples/hn-app) | Rendu HTML | 3000 | Auth, voting, comments |
219
+ | [Pet Store](examples/petstore) | Rendu HTML | 3000 | Cart, session, filters |
220
+ | [Blog CMS (HTML)](examples/blog-app-html) | Rendu HTML | 3001 | Posts, admin, comments |
221
+ | [Blog CMS (React)](examples/blog-app-tsx) | React SSR | 3002 | Posts, admin, comments |
222
+ | [Blog CMS (Inertia)](examples/blog-app-inertia-react) | Inertia React | 3003 | Posts, admin, comments |
223
+ | [HMVC Demo](examples/hmvc-app) | Rendu HTML | 3005 | Blog+Shop+Admin modules |
224
+
225
+ ---
226
+
227
+ ## License
228
+
229
+ MIT — 2026 Bunigniter Contributors
package/dist/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NexusTS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/README.md ADDED
@@ -0,0 +1,229 @@
1
+ # Bunigniter
2
+
3
+ **Bun-native fullstack framework — CodeIgniter spirit × Elysia v2 performance × Edge-ready**
4
+
5
+ ```bash
6
+ bun run examples/todo-app/dev.ts # Todo app (React SSR) :3000
7
+ bun run examples/hn-app/dev.ts # Hacker News clone :3000
8
+ bun run examples/petstore/dev.ts # Pet Store + cart :3000
9
+ bun run examples/blog-app-html/dev.ts # Blog CMS (Rendu) :3001
10
+ bun run examples/blog-app-tsx/dev.ts # Blog CMS (React SSR) :3002
11
+ ```
12
+
13
+ ---
14
+
15
+ ## Why Bunigniter?
16
+
17
+ PHP developers (CodeIgniter, Laravel) moving to TypeScript face a wall: NestJS is over-engineered, Hono is too bare, AdonisJS is Node-only. **Bunigniter is the bridge.**
18
+
19
+ ```ts
20
+ // routes/users.ts — file path = URL
21
+ import { Controller } from 'bunigniter'
22
+
23
+ export class Users extends Controller {
24
+ async index() {
25
+ return this.json(await this.db.get('users'))
26
+ }
27
+ async show(id: number) {
28
+ const user = await this.db.first('SELECT * FROM users WHERE id = ?', [id])
29
+ if (!user) return this.notFound()
30
+ return this.json(user)
31
+ }
32
+ async create() {
33
+ const data = this.request.only(['name', 'email'])
34
+ const v = this.validate(data, { name: 'required|min:2', email: 'required|email' })
35
+ if (v.fails()) return this.badRequest(v.errors)
36
+ await this.db.insert('users', { name: v.data.name, email: v.data.email })
37
+ return this.json({ ok: true }, 201)
38
+ }
39
+ }
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ git clone https://github.com/nexus-ts/bunigniter.git
48
+ cd framework
49
+ bun install
50
+ bun run examples/todo-app/db/seed.ts
51
+ bun run examples/todo-app/dev.ts
52
+ # → http://localhost:3000
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Features
58
+
59
+ | Category | Features |
60
+ |----------|----------|
61
+ | **Core** | Controller, Service, DI, File-based routing, Void-style routing, HMVC modules |
62
+ | **Database** | SQLite/PostgreSQL/MySQL/D1, CI-style query builder, `db.get/insert/update/delete`, JOIN, pagination, transactions, multi-database |
63
+ | **Templates** | Rendu (PHP-style `<?= ?>`), MDX (Markdown + JSX), React SSR, Inertia protocol, auto-layouts, partial includes, named slots |
64
+ | **Auth** | Session-based auth, JWT (sign/verify/middleware), CSRF, CORS |
65
+ | **API** | OpenAPI 3.1 auto-spec, Scalar UI, `OpenAPIRegistry` for custom docs |
66
+ | **CLI** | 27 artisan-style commands (`make:*`, `db:*`, `key:generate`, `storage:link`), REPL console, Route list |
67
+ | **Realtime** | WebSocket (`ws.handle`, rooms, broadcast), SSE (`sse(ctx, send)`), Scheduler (cron) |
68
+ | **Middleware** | Logger, Rate limiter, CORS, CSRF, Timing, Auth |
69
+ | **Services** | Cache (TTL), Queue (in-memory, retry), Upload (validation), Mail (SMTP/File/Null), Image manipulation, HTTP client |
70
+ | **Security** | CSRF tokens, Rate limiting, JWT, Session encryption (AES-256-GCM + HMAC) |
71
+ | **Edge** | Cloudflare Workers, Deno, pre-built routes (`bi build:edge`) |
72
+ | **Debug** | Debug toolbar with SQL profiling, session viewer, request headers, timing |
73
+
74
+ ---
75
+
76
+ ## Feature Comparison
77
+
78
+ | Capability | Bunigniter | NestJS | AdonisJS | Hono |
79
+ |------------|:-------:|:------:|:--------:|:----:|
80
+ | Bun-native runtime | ✅ | ❌ | △ | ✅ |
81
+ | Cloudflare Workers | ✅ | △ | ❌ | ✅ |
82
+ | Class-based controllers (extends Controller) | ✅ | ✅ | ✅ | ❌ |
83
+ | File-path routing (no decorators needed) | ✅ | ❌ | ❌ | ✅ |
84
+ | PHP-style templates | ✅ | ❌ | △ | ❌ |
85
+ | CI-style query builder | ✅ | ❌ | ✅ | ❌ |
86
+ | JWT auth | ✅ | ✅ | ✅ | ❌ |
87
+ | WebSocket | ✅ | ✅ | ❌ | ✅ |
88
+ | SSE | ✅ | ❌ | ❌ | ✅ |
89
+ | HMVC modules | ✅ | ✅ | ❌ | ❌ |
90
+ | Multi-database | ✅ | ✅ | ✅ | ❌ |
91
+ | OpenAPI auto-docs | ✅ | ✅ | ❌ | ✅ |
92
+ | 27 CLI commands | ✅ | ✅ | ✅ | ❌ |
93
+ | REPL console | ✅ | ✅ | ✅ | ❌ |
94
+ | Debug toolbar | ✅ | ❌ | ❌ | ❌ |
95
+ | 19 bundle entry points | ✅ | ❌ | ❌ | ✅ |
96
+ | No build step required (Bun native) | ✅ | ❌ | ❌ | ✅ |
97
+ | Field injection | ✅ | ❌ | ❌ | ❌ |
98
+
99
+ ---
100
+
101
+ ## Architecture
102
+
103
+ ```
104
+ routes/ ← Controllers & API handlers
105
+ users.ts ← CRUD controller
106
+ sse.ts ← Server-Sent Events
107
+ ws.ts ← WebSocket handlers
108
+ schedule.ts ← Cron tasks
109
+
110
+ views/ ← Templates
111
+ _layout.html ← Auto-layout (wraps all pages)
112
+ welcome.html ← Rendu (PHP-style <?= ?>)
113
+ About.mdx ← MDX (Markdown + variables)
114
+ TodoList.tsx ← React SSR component
115
+
116
+ modules/ ← HMVC modules (optional)
117
+ blog/routes/ ← /blog/*
118
+ shop/routes/ ← /shop/*
119
+ admin/routes/ ← /admin/*
120
+
121
+ config/app.ts ← Single config file
122
+ db/seed.ts ← Database seeder
123
+ ```
124
+
125
+ ---
126
+
127
+ ## CLI Reference (27 commands)
128
+
129
+ ```bash
130
+ bun run bi # Show help
131
+ bun run bi list # List all routes
132
+ bun run bi repl # Interactive console
133
+ bun run bi make:controller # Scaffold controller
134
+ bun run bi make:model # Scaffold DB schema
135
+ bun run bi make:migration # Create migration
136
+ bun run bi db:migrate # Run migrations
137
+ bun run bi db:seed # Run seeders
138
+ bun run bi db:rollback # Rollback migration
139
+ bun run bi db:wipe # Drop all tables
140
+ bun run bi make:seeder # Scaffold seeder
141
+ bun run bi make:middleware # Scaffold middleware
142
+ bun run bi make:command # Scaffold CLI command
143
+ bun run bi make:test # Scaffold test
144
+ bun run bi make:event # Scaffold event class
145
+ bun run bi make:job # Scaffold queue job
146
+ bun run bi make:mail # Scaffold mail class
147
+ bun run bi make:listener # Scaffold event listener
148
+ bun run bi make:provider # Scaffold service provider
149
+ bun run bi make:policy # Scaffold policy
150
+ bun run bi make:request # Scaffold form request
151
+ bun run bi make:resource # Scaffold API resource
152
+ bun run bi make:rule # Scaffold validation rule
153
+ bun run bi key:generate # Generate APP_KEY
154
+ bun run bi storage:link # Create storage symlink
155
+ bun run bi build:edge # Build edge routes
156
+ bun run bi edge:dev # Run edge app locally
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Database
162
+
163
+ CodeIgniter-style query builder with 11 helper methods:
164
+
165
+ ```ts
166
+ await db.insert('users', { name: 'Alice', email: 'a@b.com' })
167
+ await db.update('users', { name: 'Bob' }, { id: 1 })
168
+ await db.delete('users', { id: 1 })
169
+ await db.get('users', { role: 'admin' }, { orderBy: 'name', limit: 10 })
170
+ await db.getJoin('posts p', [['users u', 'u.id = p.user_id']], { where: { published: 1 } })
171
+ await db.count('users', { role: 'admin' })
172
+ await db.paginate('SELECT * FROM users', [], { page: 2, perPage: 20 })
173
+ await db.first('SELECT * FROM users WHERE id = ?', [1])
174
+ await db.sql\`SELECT * FROM users WHERE id = ${id}\`
175
+ await db.transaction(async (tx) => { ... })
176
+ ```
177
+
178
+ Supports SQLite, PostgreSQL, MySQL, Cloudflare D1. WHERE operators: `=`, `>`, `<`, `>=`, `<=`, `<>`, `LIKE`, `IN`.
179
+
180
+ ---
181
+
182
+ ## Templates (3 Engines)
183
+
184
+ | Engine | File | Syntax | Example |
185
+ |--------|------|--------|---------|
186
+ | **Rendu** | `.html` | `<?= title ?>` | PHP-style |
187
+ | **MDX** | `.mdx` | `{{ title }}` + Markdown | Documentation pages |
188
+ | **React SSR** | `.tsx` | `{title}` (JSX) | Full component control |
189
+
190
+ Auto-layout: `views/_layout.html` wraps all pages automatically. Named slots: `<?= slot_sidebar ?? '' ?>`.
191
+
192
+ ---
193
+
194
+ ## Documentation
195
+
196
+ | Guide | File |
197
+ |-------|------|
198
+ | Controller Lifecycle | [docs/user-guide/controller-lifecycle.md](docs/user-guide/controller-lifecycle.md) |
199
+ | Request Input | [docs/user-guide/request.md](docs/user-guide/request.md) |
200
+ | Template Engine | [docs/user-guide/template-engine.md](docs/user-guide/template-engine.md) |
201
+ | Database | [docs/user-guide/database.md](docs/user-guide/database.md) |
202
+ | Multi-Database | [docs/user-guide/multi-database.md](docs/user-guide/multi-database.md) |
203
+ | HMVC Modules | [docs/user-guide/hmvc-modules.md](docs/user-guide/hmvc-modules.md) |
204
+ | OpenAPI | [docs/user-guide/openapi.md](docs/user-guide/openapi.md) |
205
+ | JWT Auth | [docs/user-guide/jwt-auth.md](docs/user-guide/jwt-auth.md) |
206
+ | WebSocket | [docs/user-guide/websocket.md](docs/user-guide/websocket.md) |
207
+ | SSE | [docs/user-guide/sse.md](docs/user-guide/sse.md) |
208
+ | CLI Reference | [docs/user-guide/cli-reference.md](docs/user-guide/cli-reference.md) |
209
+ | Helpers Reference | [docs/user-guide/helpers.md](docs/user-guide/helpers.md) |
210
+
211
+ ---
212
+
213
+ ## Example Apps
214
+
215
+ | App | Stack | Port | Features |
216
+ |-----|-------|:----:|----------|
217
+ | [Todo App](examples/todo-app) | React SSR | 3000 | CRUD, filters, search |
218
+ | [Hacker News](examples/hn-app) | Rendu HTML | 3000 | Auth, voting, comments |
219
+ | [Pet Store](examples/petstore) | Rendu HTML | 3000 | Cart, session, filters |
220
+ | [Blog CMS (HTML)](examples/blog-app-html) | Rendu HTML | 3001 | Posts, admin, comments |
221
+ | [Blog CMS (React)](examples/blog-app-tsx) | React SSR | 3002 | Posts, admin, comments |
222
+ | [Blog CMS (Inertia)](examples/blog-app-inertia-react) | Inertia React | 3003 | Posts, admin, comments |
223
+ | [HMVC Demo](examples/hmvc-app) | Rendu HTML | 3005 | Blog+Shop+Admin modules |
224
+
225
+ ---
226
+
227
+ ## License
228
+
229
+ MIT — 2026 Bunigniter Contributors