create-backurus-app 1.0.0 → 1.0.3
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.
- package/bin/index.js +5 -1
- package/package.json +2 -2
- package/template/Backurus.desktop +11 -0
- package/template/README.md +165 -263
- package/template/app/controllers/ProductController.js +1 -1
- package/template/docs/assets/css/style.css +145 -152
- package/template/docs/assets/js/main.js +10 -7
- package/template/docs/authentication.html +22 -4
- package/template/docs/cli.html +22 -4
- package/template/docs/controllers.html +35 -6
- package/template/docs/index.html +13 -4
- package/template/docs/installation.html +23 -4
- package/template/docs/lang/en.json +96 -96
- package/template/docs/lang/id.json +93 -95
- package/template/docs/migrations.html +22 -4
- package/template/docs/models.html +36 -8
- package/template/docs/plugins.html +20 -3
- package/template/docs/queue.html +23 -7
- package/template/docs/quickstart.html +23 -3
- package/template/docs/routing.html +23 -4
- package/template/docs/validation.html +22 -3
- package/template/docs/websocket.html +20 -3
- package/template/node_modules/chokidar/esm/handler.d.ts +1 -1
- package/template/node_modules/chokidar/esm/index.d.ts +1 -1
- package/template/node_modules/ioredis/built/Command.d.ts +1 -1
- package/template/node_modules/ioredis/built/DataHandler.d.ts +2 -2
- package/template/node_modules/ioredis/built/Pipeline.d.ts +4 -4
- package/template/node_modules/ioredis/built/Redis.d.ts +8 -8
- package/template/node_modules/ioredis/built/SubscriptionSet.d.ts +1 -1
- package/template/node_modules/ioredis/built/cluster/ClusterOptions.d.ts +3 -3
- package/template/node_modules/ioredis/built/cluster/index.d.ts +8 -8
- package/template/node_modules/ioredis/built/connectors/AbstractConnector.d.ts +1 -1
- package/template/node_modules/ioredis/built/connectors/ConnectorConstructor.d.ts +1 -1
- package/template/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.d.ts +1 -1
- package/template/node_modules/ioredis/built/connectors/SentinelConnector/index.d.ts +5 -5
- package/template/node_modules/ioredis/built/connectors/SentinelConnector/types.d.ts +1 -1
- package/template/node_modules/ioredis/built/connectors/StandaloneConnector.d.ts +2 -2
- package/template/node_modules/ioredis/built/index.d.ts +17 -17
- package/template/node_modules/ioredis/built/redis/RedisOptions.d.ts +4 -4
- package/template/node_modules/ioredis/built/transaction.d.ts +1 -1
- package/template/node_modules/ioredis/built/utils/Commander.d.ts +3 -3
- package/template/node_modules/ioredis/built/utils/RedisCommander.d.ts +1 -1
- package/template/node_modules/mysql2/promise.d.ts +2 -2
- package/template/node_modules/mysql2/typings/mysql/lib/Connection.d.ts +1 -1
- package/template/node_modules/mysql2/typings/mysql/lib/Pool.d.ts +1 -1
- package/template/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts +1 -1
- package/template/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts +1 -1
- package/template/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts +1 -1
package/bin/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import fs from "fs-extra"
|
|
4
|
+
import { fileURLToPath } from "url"
|
|
4
5
|
import path from "path"
|
|
5
6
|
import inquirer from "inquirer"
|
|
6
7
|
import chalk from "chalk"
|
|
7
8
|
import { execSync } from "child_process"
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
const __dirname = path.dirname(__filename)
|
|
12
|
+
|
|
13
|
+
const templateDir = path.join(__dirname, "../template")
|
|
10
14
|
|
|
11
15
|
async function run() {
|
|
12
16
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[Desktop Entry]
|
|
2
|
+
Version=1.0
|
|
3
|
+
Type=Application
|
|
4
|
+
Name=Backurus CLI
|
|
5
|
+
Comment=Run Backurus CLI from the project root
|
|
6
|
+
Exec=node /home/rakarawr/Documents/project/2026/testai/urus
|
|
7
|
+
Icon=/home/rakarawr/Documents/project/2026/testai/docs/images/favicon.png
|
|
8
|
+
Path=/home/rakarawr/Documents/project/2026/testai
|
|
9
|
+
Terminal=true
|
|
10
|
+
Categories=Development;
|
|
11
|
+
StartupNotify=false
|
package/template/README.md
CHANGED
|
@@ -1,157 +1,77 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Backurus
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Modern Backend Framework for Node.js inspired by Laravel.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
Laravel-inspired backend framework for Node.js with a fast API-first workflow.
|
|
7
|
-
</p>
|
|
5
|
+
## Introduction
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
<img alt="ESM" src="https://img.shields.io/badge/module-ESM-1f2937?style=for-the-badge">
|
|
11
|
-
<img alt="API First" src="https://img.shields.io/badge/focus-API%20First-f97316?style=for-the-badge">
|
|
12
|
-
</p>
|
|
7
|
+
Backurus is a backend framework built to make API development simple, fast, and structured. It combines a Laravel-like developer experience with a lightweight JavaScript runtime, modern ES Modules, and an API-first architecture that stays productive as projects grow.
|
|
13
8
|
|
|
14
|
-
Backurus
|
|
9
|
+
Backurus includes:
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
- ORM bergaya Eloquent untuk CRUD, pagination, relationship, dan soft delete
|
|
22
|
-
- migration + seeder untuk workflow database yang rapi
|
|
23
|
-
- validasi request, JWT auth, queue, scheduler, plugin, facade, dan WebSocket
|
|
24
|
-
- CLI generator yang langsung usable untuk bikin module API baru
|
|
25
|
-
- dokumentasi lokal multilingual di folder `docs/`
|
|
26
|
-
|
|
27
|
-
Kalau tujuan Anda adalah bikin backend API dengan cepat tanpa tenggelam di boilerplate Express mentah atau kompleksitas framework besar, Backurus berada di posisi yang kuat.
|
|
28
|
-
|
|
29
|
-
## Keunggulan Dibanding Framework Lain
|
|
30
|
-
|
|
31
|
-
### 1. Lebih opinionated daripada Express
|
|
32
|
-
|
|
33
|
-
Express memberi kebebasan, tapi kebebasan itu sering berubah jadi keputusan teknis kecil yang berulang: struktur folder, validasi, auth, migration, response helper, dan pola controller. Backurus sudah menetapkan fondasi itu dari awal, jadi developer bisa langsung fokus ke business logic.
|
|
34
|
-
|
|
35
|
-
### 2. Lebih ringan secara mental daripada NestJS
|
|
36
|
-
|
|
37
|
-
NestJS sangat kuat, tapi sering terasa berat untuk project API yang hanya butuh alur cepat dan sederhana. Backurus memilih API yang lebih langsung: file-based structure yang mudah dibaca, controller sederhana, dan command CLI yang pragmatis.
|
|
38
|
-
|
|
39
|
-
### 3. Lebih familiar untuk developer Laravel/PHP
|
|
40
|
-
|
|
41
|
-
Banyak naming dan alur di Backurus sengaja dibuat familiar:
|
|
42
|
-
|
|
43
|
-
- `node urus make:controller`
|
|
44
|
-
- `node urus migrate`
|
|
45
|
-
- `node urus db:seed`
|
|
46
|
-
- middleware alias
|
|
47
|
-
- request validation class
|
|
48
|
-
- facade kecil untuk service penting
|
|
49
|
-
- `storage:link` style workflow
|
|
50
|
-
|
|
51
|
-
Artinya, onboarding dari Laravel ke Node.js terasa jauh lebih halus.
|
|
52
|
-
|
|
53
|
-
### 4. API-first dari awal
|
|
54
|
-
|
|
55
|
-
Backurus jelas diarahkan untuk backend API:
|
|
56
|
-
|
|
57
|
-
- response JSON helper
|
|
58
|
-
- JWT auth
|
|
59
|
-
- queue dan scheduler
|
|
60
|
-
- upload file multipart
|
|
61
|
-
- public storage URL
|
|
62
|
-
- route listing
|
|
63
|
-
- WebSocket bawaan
|
|
64
|
-
|
|
65
|
-
Ini bukan framework fullstack yang kebetulan bisa bikin API. Ini framework backend yang memang dibangun untuk itu.
|
|
66
|
-
|
|
67
|
-
## Fitur Inti
|
|
68
|
-
|
|
69
|
-
- `node urus` CLI untuk generator dan operational workflow
|
|
70
|
-
- ES Modules native
|
|
71
|
-
- HTTP server internal dengan router sendiri
|
|
72
|
-
- controller string action ala Laravel
|
|
73
|
-
- request parser JSON, urlencoded, dan multipart form-data
|
|
74
|
-
- file upload dan public disk storage
|
|
75
|
-
- ORM dengan CRUD, query builder, pagination, timestamps, soft deletes, relationship
|
|
76
|
-
- schema builder + migration untuk SQLite dan MySQL
|
|
77
|
-
- request validation class
|
|
11
|
+
- Laravel-like CLI with `node urus`
|
|
12
|
+
- expressive routing with controller actions
|
|
13
|
+
- built-in ORM with query builder and relationships
|
|
14
|
+
- schema migrations and seeders
|
|
15
|
+
- request validation classes
|
|
78
16
|
- JWT authentication
|
|
79
|
-
- middleware
|
|
80
|
-
-
|
|
81
|
-
- plugin system
|
|
82
|
-
- facade layer untuk service framework
|
|
83
|
-
- WebSocket hub bawaan
|
|
84
|
-
- docs website lokal di `docs/`
|
|
85
|
-
|
|
86
|
-
## Siapa yang Cocok Pakai Backurus?
|
|
87
|
-
|
|
88
|
-
Backurus cocok untuk:
|
|
89
|
-
|
|
90
|
-
- developer Laravel yang ingin pindah ke Node.js tanpa kehilangan ergonomi
|
|
91
|
-
- tim kecil yang ingin delivery API cepat
|
|
92
|
-
- project admin panel backend, mobile API, internal tools, dan SaaS backend
|
|
93
|
-
- eksperimen framework custom yang tetap punya struktur serius
|
|
94
|
-
|
|
95
|
-
Backurus kurang cocok jika Anda butuh:
|
|
96
|
-
|
|
97
|
-
- ekosistem plugin sebesar Express/NestJS
|
|
98
|
-
- convention enterprise yang sangat kompleks
|
|
99
|
-
- integrasi frontend SSR atau fullstack rendering sebagai fokus utama
|
|
17
|
+
- middleware aliases
|
|
18
|
+
- hot reload development server
|
|
100
19
|
|
|
101
|
-
##
|
|
20
|
+
## Installation
|
|
102
21
|
|
|
103
|
-
|
|
22
|
+
To start a new Backurus project, the intended workflow is:
|
|
104
23
|
|
|
105
24
|
```bash
|
|
106
|
-
|
|
25
|
+
npx create-backurus-app my-api
|
|
26
|
+
cd my-api
|
|
27
|
+
node urus serve
|
|
107
28
|
```
|
|
108
29
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Sesuaikan `.env` Anda. Secara default project ini bisa jalan dengan SQLite di `storage/database.sqlite`.
|
|
112
|
-
|
|
113
|
-
### 3. Jalankan migration dan seeder
|
|
30
|
+
For this repository scaffold, install dependencies and boot the framework locally:
|
|
114
31
|
|
|
115
32
|
```bash
|
|
33
|
+
npm install
|
|
116
34
|
node urus migrate
|
|
117
35
|
node urus db:seed
|
|
36
|
+
node urus serve
|
|
118
37
|
```
|
|
119
38
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
39
|
+
Backurus reads environment variables from `.env`. Typical keys are:
|
|
40
|
+
|
|
41
|
+
```env
|
|
42
|
+
APP_NAME=Backurus
|
|
43
|
+
APP_PORT=3000
|
|
44
|
+
DB_CONNECTION=mysql
|
|
45
|
+
DB_HOST=127.0.0.1
|
|
46
|
+
DB_PORT=3306
|
|
47
|
+
DB_DATABASE=testfw
|
|
48
|
+
DB_USERNAME=root
|
|
49
|
+
DB_PASSWORD=secret
|
|
50
|
+
JWT_SECRET=supersecretkey
|
|
51
|
+
QUEUE_CONNECTION=sync
|
|
130
52
|
```
|
|
131
53
|
|
|
132
|
-
|
|
54
|
+
## CLI Commands
|
|
133
55
|
|
|
134
|
-
|
|
56
|
+
All framework commands run through `node urus`.
|
|
135
57
|
|
|
136
|
-
|
|
58
|
+
### Core commands
|
|
137
59
|
|
|
138
60
|
```bash
|
|
139
|
-
node urus make:model Product
|
|
140
|
-
node urus make:controller ProductController
|
|
141
|
-
node urus make:migration create_products_table
|
|
142
|
-
node urus migrate
|
|
143
61
|
node urus serve
|
|
62
|
+
node urus migrate
|
|
63
|
+
node urus route:list
|
|
144
64
|
```
|
|
145
65
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
66
|
+
- `node urus serve`: start the development server with file watching and auto-restart.
|
|
67
|
+
- `node urus migrate`: run pending database migrations.
|
|
68
|
+
- `node urus route:list`: print the registered routes, methods, URIs, actions, and names.
|
|
149
69
|
|
|
150
70
|
### Generators
|
|
151
71
|
|
|
152
72
|
```bash
|
|
153
|
-
node urus make:controller UserController
|
|
154
73
|
node urus make:model User
|
|
74
|
+
node urus make:controller UserController
|
|
155
75
|
node urus make:migration create_users_table
|
|
156
76
|
node urus make:middleware AuthMiddleware
|
|
157
77
|
node urus make:request StoreUserRequest
|
|
@@ -163,202 +83,184 @@ node urus make:resource UserResource
|
|
|
163
83
|
node urus make:module Admin
|
|
164
84
|
```
|
|
165
85
|
|
|
166
|
-
|
|
86
|
+
- `make:model`: generate a model class in `app/models`.
|
|
87
|
+
- `make:controller`: generate a controller in `app/controllers`.
|
|
88
|
+
- `make:migration`: generate a migration file in `database/migrations`.
|
|
89
|
+
- `make:middleware`: generate a middleware function in `app/middleware`.
|
|
90
|
+
- `make:request`: generate a request validation class in `app/requests`.
|
|
91
|
+
- `make:job`: generate a queue job class.
|
|
92
|
+
- `make:event`: generate an event payload class.
|
|
93
|
+
- `make:seeder`: generate a database seeder.
|
|
94
|
+
- `make:policy`: generate an authorization policy.
|
|
95
|
+
- `make:resource`: generate an API resource transformer.
|
|
96
|
+
- `make:module`: generate a module directory with common subfolders.
|
|
97
|
+
|
|
98
|
+
### Database and runtime commands
|
|
167
99
|
|
|
168
100
|
```bash
|
|
169
|
-
node urus migrate
|
|
170
101
|
node urus migrate:rollback
|
|
171
102
|
node urus migrate:reset
|
|
172
103
|
node urus migrate:fresh
|
|
173
104
|
node urus migrate:status
|
|
174
105
|
node urus db:seed
|
|
175
|
-
node urus route:list
|
|
176
106
|
node urus queue:work
|
|
177
107
|
node urus queue:restart
|
|
178
108
|
node urus schedule:run
|
|
179
|
-
node urus serve
|
|
180
|
-
node urus storage:link
|
|
181
109
|
node urus config:cache
|
|
182
110
|
node urus config:clear
|
|
111
|
+
node urus storage:link
|
|
183
112
|
```
|
|
184
113
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
114
|
+
- `migrate:rollback`: roll back the latest migration batch.
|
|
115
|
+
- `migrate:reset`: roll back all applied migrations.
|
|
116
|
+
- `migrate:fresh`: drop all known tables and re-run migrations.
|
|
117
|
+
- `migrate:status`: show which migrations have run.
|
|
118
|
+
- `db:seed`: execute all seeders, or one named seeder.
|
|
119
|
+
- `queue:work`: start the queue worker.
|
|
120
|
+
- `queue:restart`: signal long-running workers to restart.
|
|
121
|
+
- `schedule:run`: execute due scheduled commands.
|
|
122
|
+
- `config:cache`: cache resolved config to disk.
|
|
123
|
+
- `config:clear`: clear cached config.
|
|
124
|
+
- `storage:link`: create `public/storage` symlink to `storage/app/public`.
|
|
194
125
|
|
|
195
|
-
##
|
|
126
|
+
## Project Structure
|
|
196
127
|
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return res.created(product, 'Product created')
|
|
219
|
-
}
|
|
220
|
-
}
|
|
128
|
+
```text
|
|
129
|
+
app/
|
|
130
|
+
controllers/
|
|
131
|
+
events/
|
|
132
|
+
jobs/
|
|
133
|
+
middleware/
|
|
134
|
+
models/
|
|
135
|
+
requests/
|
|
136
|
+
resources/
|
|
137
|
+
services/
|
|
138
|
+
bootstrap/
|
|
139
|
+
config/
|
|
140
|
+
core/
|
|
141
|
+
database/
|
|
142
|
+
migrations/
|
|
143
|
+
seeders/
|
|
144
|
+
docs/
|
|
145
|
+
plugins/
|
|
146
|
+
routes/
|
|
147
|
+
urus
|
|
148
|
+
.env
|
|
221
149
|
```
|
|
222
150
|
|
|
223
|
-
|
|
151
|
+
- `app/`: application code such as controllers, models, middleware, jobs, and requests.
|
|
152
|
+
- `bootstrap/`: application bootstrapping and container setup.
|
|
153
|
+
- `config/`: framework and app configuration files.
|
|
154
|
+
- `core/`: framework internals such as router, ORM, server, scheduler, queue, and facades.
|
|
155
|
+
- `database/`: migrations and seeders.
|
|
156
|
+
- `docs/`: static documentation website with EN and ID translations.
|
|
157
|
+
- `plugins/`: plugin entry points that auto-load on boot.
|
|
158
|
+
- `routes/`: route definitions and scheduled console commands.
|
|
159
|
+
- `urus`: CLI launcher for all Backurus commands.
|
|
224
160
|
|
|
225
|
-
|
|
161
|
+
## Example API
|
|
226
162
|
|
|
227
|
-
|
|
163
|
+
Example route:
|
|
228
164
|
|
|
229
|
-
```
|
|
230
|
-
|
|
165
|
+
```javascript
|
|
166
|
+
Route.get('/users', 'UserController@index')
|
|
231
167
|
```
|
|
232
168
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
```text
|
|
236
|
-
public/storage -> storage/app/public
|
|
237
|
-
```
|
|
169
|
+
Example controller:
|
|
238
170
|
|
|
239
|
-
|
|
171
|
+
```javascript
|
|
172
|
+
import User from '../models/User'
|
|
240
173
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
async store(req, res) {
|
|
246
|
-
const image = req.file('image')
|
|
247
|
-
const storedPath = image
|
|
248
|
-
? await Storage.disk('public').putFile('products', image)
|
|
249
|
-
: null
|
|
250
|
-
|
|
251
|
-
const imageUrl = storedPath
|
|
252
|
-
? Storage.disk('public').url(storedPath)
|
|
253
|
-
: null
|
|
254
|
-
|
|
255
|
-
return res.created({
|
|
256
|
-
image: storedPath,
|
|
257
|
-
image_url: imageUrl
|
|
258
|
-
})
|
|
174
|
+
export default class UserController {
|
|
175
|
+
async index(req, res) {
|
|
176
|
+
const users = await User.all()
|
|
177
|
+
return res.success(users)
|
|
259
178
|
}
|
|
260
179
|
}
|
|
261
180
|
```
|
|
262
181
|
|
|
263
|
-
|
|
182
|
+
## Migration Example
|
|
264
183
|
|
|
265
|
-
-
|
|
266
|
-
- `req.file('fieldName')`
|
|
184
|
+
Backurus migrations use a schema builder with Laravel-like table methods:
|
|
267
185
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
jobs/
|
|
277
|
-
events/
|
|
278
|
-
policies/
|
|
279
|
-
modules/
|
|
280
|
-
bootstrap/
|
|
281
|
-
config/
|
|
282
|
-
core/
|
|
283
|
-
database/
|
|
284
|
-
migrations/
|
|
285
|
-
seeders/
|
|
286
|
-
routes/
|
|
287
|
-
plugins/
|
|
288
|
-
docs/
|
|
186
|
+
```javascript
|
|
187
|
+
await schema.create('users', (table) => {
|
|
188
|
+
table.id()
|
|
189
|
+
table.string('name')
|
|
190
|
+
table.string('email').unique()
|
|
191
|
+
table.enum('role', ['admin', 'user']).default('user')
|
|
192
|
+
table.timestamps()
|
|
193
|
+
})
|
|
289
194
|
```
|
|
290
195
|
|
|
291
|
-
|
|
196
|
+
Supported column types include `string`, `text`, `integer`, `bigInteger`, `boolean`, `date`, `datetime`, `timestamp`, `enum`, `json`, `float`, `double`, and `decimal`.
|
|
292
197
|
|
|
293
|
-
|
|
198
|
+
Supported modifiers include `nullable()`, `default()`, `unique()`, `index()`, and `unsigned()`.
|
|
294
199
|
|
|
295
|
-
|
|
296
|
-
- `config/database.js`
|
|
297
|
-
- `config/auth.js`
|
|
298
|
-
- `config/queue.js`
|
|
299
|
-
- `config/storage.js`
|
|
200
|
+
## ORM Example
|
|
300
201
|
|
|
301
|
-
|
|
202
|
+
Backurus models expose a compact Eloquent-style API:
|
|
302
203
|
|
|
303
|
-
|
|
204
|
+
```javascript
|
|
205
|
+
const users = await User.all()
|
|
304
206
|
|
|
305
|
-
|
|
207
|
+
const user = await User.find(1)
|
|
306
208
|
|
|
307
|
-
|
|
308
|
-
|
|
209
|
+
await User.create({
|
|
210
|
+
name: 'Rakha'
|
|
211
|
+
})
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Common query builder patterns:
|
|
309
215
|
|
|
310
|
-
|
|
216
|
+
```javascript
|
|
217
|
+
await User.where('age', '>', 18).get()
|
|
218
|
+
await User.where('email', 'rakha@email.com').first()
|
|
219
|
+
await User.orderBy('created_at', 'desc').limit(10).get()
|
|
220
|
+
await User.paginate(1, 10)
|
|
221
|
+
await User.with('posts').find(1)
|
|
222
|
+
```
|
|
311
223
|
|
|
312
|
-
##
|
|
224
|
+
## Documentation Website
|
|
313
225
|
|
|
314
|
-
|
|
226
|
+
The `docs/` folder contains a static documentation site with:
|
|
315
227
|
|
|
316
228
|
- introduction
|
|
317
229
|
- installation
|
|
318
|
-
-
|
|
230
|
+
- CLI commands
|
|
319
231
|
- routing
|
|
320
232
|
- controllers
|
|
321
233
|
- models
|
|
322
234
|
- migrations
|
|
323
235
|
- validation
|
|
324
236
|
- authentication
|
|
325
|
-
- queue
|
|
326
|
-
-
|
|
327
|
-
- plugins
|
|
328
|
-
- CLI
|
|
329
|
-
|
|
330
|
-
Logo Backurus juga sudah dipakai konsisten di dokumentasi lokal tersebut.
|
|
331
|
-
|
|
332
|
-
## Posisi Backurus
|
|
333
|
-
|
|
334
|
-
Backurus bukan sekadar clone Laravel dalam JavaScript. Nilai utamanya ada pada kombinasi berikut:
|
|
335
|
-
|
|
336
|
-
- DX yang familiar
|
|
337
|
-
- codebase yang kecil dan mudah dipahami
|
|
338
|
-
- fitur backend yang sudah lengkap untuk API modern
|
|
339
|
-
- struktur yang cukup opinionated untuk menjaga kecepatan tim
|
|
340
|
-
|
|
341
|
-
Jika Express terlalu mentah dan NestJS terasa terlalu berat, Backurus mengisi ruang di tengah dengan pendekatan yang lebih pragmatis.
|
|
237
|
+
- queue and scheduler
|
|
238
|
+
- WebSocket
|
|
239
|
+
- plugins and facades
|
|
342
240
|
|
|
343
|
-
|
|
241
|
+
The documentation website includes:
|
|
344
242
|
|
|
345
|
-
|
|
243
|
+
- sidebar navigation
|
|
244
|
+
- top navbar
|
|
245
|
+
- syntax highlighted code blocks
|
|
246
|
+
- copy code button
|
|
247
|
+
- dark mode toggle
|
|
248
|
+
- client-side search
|
|
249
|
+
- English and Indonesian translations
|
|
346
250
|
|
|
347
|
-
|
|
348
|
-
- storage adapter tambahan seperti S3-compatible disk
|
|
349
|
-
- cache driver yang lebih kaya
|
|
350
|
-
- mailer abstraction
|
|
351
|
-
- OpenAPI generation yang lebih dalam
|
|
352
|
-
- rate limiting dan observability yang lebih detail
|
|
251
|
+
Open [docs/index.html](/home/rakarawr/Documents/project/2026/testai/docs/index.html) in a browser to browse the local docs.
|
|
353
252
|
|
|
354
|
-
##
|
|
253
|
+
## Backurus Workflow
|
|
355
254
|
|
|
356
|
-
|
|
255
|
+
A typical API workflow looks like this:
|
|
357
256
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
257
|
+
```bash
|
|
258
|
+
node urus make:model Product
|
|
259
|
+
node urus make:controller ProductController
|
|
260
|
+
node urus make:request StoreProductRequest
|
|
261
|
+
node urus make:migration create_products_table
|
|
262
|
+
node urus migrate
|
|
263
|
+
node urus serve
|
|
264
|
+
```
|
|
363
265
|
|
|
364
|
-
|
|
266
|
+
Backurus is built for teams that want the ergonomics of Laravel with the runtime and ecosystem of Node.js.
|
|
@@ -2,7 +2,7 @@ import Product from '../models/Product'
|
|
|
2
2
|
import StoreProductRequest from '../requests/StoreProductRequest'
|
|
3
3
|
import { validate } from '../../core/validator'
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function normalizePayload(body) {
|
|
6
6
|
return {
|
|
7
7
|
name: body.name,
|
|
8
8
|
description: body.description || null,
|