create-backurus-app 1.0.0 → 1.0.1

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 (47) hide show
  1. package/package.json +1 -1
  2. package/template/Backurus.desktop +11 -0
  3. package/template/README.md +165 -263
  4. package/template/app/controllers/ProductController.js +1 -1
  5. package/template/docs/assets/css/style.css +145 -152
  6. package/template/docs/assets/js/main.js +10 -7
  7. package/template/docs/authentication.html +22 -4
  8. package/template/docs/cli.html +22 -4
  9. package/template/docs/controllers.html +35 -6
  10. package/template/docs/index.html +13 -4
  11. package/template/docs/installation.html +23 -4
  12. package/template/docs/lang/en.json +96 -96
  13. package/template/docs/lang/id.json +93 -95
  14. package/template/docs/migrations.html +22 -4
  15. package/template/docs/models.html +36 -8
  16. package/template/docs/plugins.html +20 -3
  17. package/template/docs/queue.html +23 -7
  18. package/template/docs/quickstart.html +23 -3
  19. package/template/docs/routing.html +23 -4
  20. package/template/docs/validation.html +22 -3
  21. package/template/docs/websocket.html +20 -3
  22. package/template/node_modules/chokidar/esm/handler.d.ts +1 -1
  23. package/template/node_modules/chokidar/esm/index.d.ts +1 -1
  24. package/template/node_modules/ioredis/built/Command.d.ts +1 -1
  25. package/template/node_modules/ioredis/built/DataHandler.d.ts +2 -2
  26. package/template/node_modules/ioredis/built/Pipeline.d.ts +4 -4
  27. package/template/node_modules/ioredis/built/Redis.d.ts +8 -8
  28. package/template/node_modules/ioredis/built/SubscriptionSet.d.ts +1 -1
  29. package/template/node_modules/ioredis/built/cluster/ClusterOptions.d.ts +3 -3
  30. package/template/node_modules/ioredis/built/cluster/index.d.ts +8 -8
  31. package/template/node_modules/ioredis/built/connectors/AbstractConnector.d.ts +1 -1
  32. package/template/node_modules/ioredis/built/connectors/ConnectorConstructor.d.ts +1 -1
  33. package/template/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.d.ts +1 -1
  34. package/template/node_modules/ioredis/built/connectors/SentinelConnector/index.d.ts +5 -5
  35. package/template/node_modules/ioredis/built/connectors/SentinelConnector/types.d.ts +1 -1
  36. package/template/node_modules/ioredis/built/connectors/StandaloneConnector.d.ts +2 -2
  37. package/template/node_modules/ioredis/built/index.d.ts +17 -17
  38. package/template/node_modules/ioredis/built/redis/RedisOptions.d.ts +4 -4
  39. package/template/node_modules/ioredis/built/transaction.d.ts +1 -1
  40. package/template/node_modules/ioredis/built/utils/Commander.d.ts +3 -3
  41. package/template/node_modules/ioredis/built/utils/RedisCommander.d.ts +1 -1
  42. package/template/node_modules/mysql2/promise.d.ts +2 -2
  43. package/template/node_modules/mysql2/typings/mysql/lib/Connection.d.ts +1 -1
  44. package/template/node_modules/mysql2/typings/mysql/lib/Pool.d.ts +1 -1
  45. package/template/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts +1 -1
  46. package/template/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts +1 -1
  47. package/template/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-backurus-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "bin": {
5
5
  "create-backurus-app": "./bin/index.js"
6
6
  },
@@ -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
@@ -1,157 +1,77 @@
1
- # <div align="center"><img src="./docs/images/favicon.png" alt="Backurus logo" width="120" /></div>
1
+ # Backurus
2
2
 
3
- # <div align="center">Backurus</div>
3
+ A Modern Backend Framework for Node.js inspired by Laravel.
4
4
 
5
- <p align="center">
6
- Laravel-inspired backend framework for Node.js with a fast API-first workflow.
7
- </p>
5
+ ## Introduction
8
6
 
9
- <p align="center">
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 adalah framework backend berbasis Node.js yang dirancang untuk developer yang suka ergonomi Laravel, tapi ingin runtime JavaScript modern, struktur sederhana, dan pengalaman membangun REST API yang cepat. Fokus Backurus bukan jadi framework serba bisa yang berat, tapi jadi framework yang enak dipakai untuk membangun API production-style dengan pola yang familiar.
9
+ Backurus includes:
15
10
 
16
- ## Kenapa Backurus?
17
-
18
- Backurus menggabungkan beberapa hal yang biasanya terpencar:
19
-
20
- - routing gaya Laravel dengan action string seperti `ProductController@index`
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 alias system
80
- - event bus, queue worker, dan scheduler
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
- ## Quick Start
20
+ ## Installation
102
21
 
103
- ### 1. Install dependency
22
+ To start a new Backurus project, the intended workflow is:
104
23
 
105
24
  ```bash
106
- npm install
25
+ npx create-backurus-app my-api
26
+ cd my-api
27
+ node urus serve
107
28
  ```
108
29
 
109
- ### 2. Siapkan environment
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
- ### 4. Aktifkan public storage link
121
-
122
- ```bash
123
- node urus storage:link
124
- ```
125
-
126
- ### 5. Jalankan server
127
-
128
- ```bash
129
- node urus serve
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
- Server akan berjalan sesuai `APP_PORT` pada config aplikasi.
54
+ ## CLI Commands
133
55
 
134
- ## Pengalaman Developer
56
+ All framework commands run through `node urus`.
135
57
 
136
- Workflow Backurus sengaja dibuat pendek:
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
- Dengan alur ini, Anda tidak perlu merakit stack backend dari nol setiap kali memulai module baru.
147
-
148
- ## CLI Utama
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
- ### Database dan runtime
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
- ## Contoh Routing
186
-
187
- ```js
188
- router.get('/products', 'ProductController@index')
189
- router.post('/products', 'ProductController@store')
190
- router.put('/products/:id', 'ProductController@update').middleware('auth')
191
- ```
192
-
193
- Routing model ini sengaja dibuat ringkas dan mudah dibaca.
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
- ## Contoh Controller
126
+ ## Project Structure
196
127
 
197
- ```js
198
- import Product from '../models/Product'
199
- import StoreProductRequest from '../requests/StoreProductRequest'
200
- import { validate } from '../../core/validator'
201
-
202
- export default class ProductController {
203
- async index(req, res) {
204
- const page = Number(req.query.page || 1)
205
- const perPage = Number(req.query.per_page || 10)
206
- const result = await Product.orderBy('id', 'desc').paginate(page, perPage)
207
- return res.paginated(result.data, result.meta)
208
- }
209
-
210
- async store(req, res) {
211
- await validate(req, StoreProductRequest)
212
- const product = await Product.create({
213
- name: req.body.name,
214
- description: req.body.description || null,
215
- price: Number(req.body.price),
216
- stock: Number(req.body.stock)
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
- ## Upload File dan Storage Publik
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
- Backurus sekarang sudah support upload multipart dan public storage ala workflow Laravel.
161
+ ## Example API
226
162
 
227
- ### Buat symbolic link public storage
163
+ Example route:
228
164
 
229
- ```bash
230
- node urus storage:link
165
+ ```javascript
166
+ Route.get('/users', 'UserController@index')
231
167
  ```
232
168
 
233
- Ini akan membuat:
234
-
235
- ```text
236
- public/storage -> storage/app/public
237
- ```
169
+ Example controller:
238
170
 
239
- ### Simpan file upload di controller
171
+ ```javascript
172
+ import User from '../models/User'
240
173
 
241
- ```js
242
- import { Storage } from '../../core/facades'
243
-
244
- export default class ProductController {
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
- Field upload tersedia lewat:
182
+ ## Migration Example
264
183
 
265
- - `req.files`
266
- - `req.file('fieldName')`
184
+ Backurus migrations use a schema builder with Laravel-like table methods:
267
185
 
268
- ## Arsitektur Project
269
-
270
- ```text
271
- app/
272
- controllers/
273
- models/
274
- middleware/
275
- requests/
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
- ## Konfigurasi yang Tersedia
196
+ Supported column types include `string`, `text`, `integer`, `bigInteger`, `boolean`, `date`, `datetime`, `timestamp`, `enum`, `json`, `float`, `double`, and `decimal`.
292
197
 
293
- Backurus saat ini memuat konfigurasi utama dari:
198
+ Supported modifiers include `nullable()`, `default()`, `unique()`, `index()`, and `unsigned()`.
294
199
 
295
- - `config/app.js`
296
- - `config/database.js`
297
- - `config/auth.js`
298
- - `config/queue.js`
299
- - `config/storage.js`
200
+ ## ORM Example
300
201
 
301
- Dengan pendekatan ini, konfigurasi tetap eksplisit dan mudah ditelusuri.
202
+ Backurus models expose a compact Eloquent-style API:
302
203
 
303
- ## Database Support
204
+ ```javascript
205
+ const users = await User.all()
304
206
 
305
- Driver yang sudah terlihat dipersiapkan di project:
207
+ const user = await User.find(1)
306
208
 
307
- - SQLite
308
- - MySQL
209
+ await User.create({
210
+ name: 'Rakha'
211
+ })
212
+ ```
213
+
214
+ Common query builder patterns:
309
215
 
310
- SQLite cocok untuk development cepat, sedangkan MySQL bisa dipakai untuk deployment yang lebih tradisional.
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
- ## Dokumentasi Lokal
224
+ ## Documentation Website
313
225
 
314
- Backurus menyertakan website dokumentasi di folder `docs/`, termasuk:
226
+ The `docs/` folder contains a static documentation site with:
315
227
 
316
228
  - introduction
317
229
  - installation
318
- - quickstart
230
+ - CLI commands
319
231
  - routing
320
232
  - controllers
321
233
  - models
322
234
  - migrations
323
235
  - validation
324
236
  - authentication
325
- - queue
326
- - websocket
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
- ## Roadmap yang Layak Dilanjutkan
241
+ The documentation website includes:
344
242
 
345
- Beberapa area yang secara natural bisa memperkuat Backurus ke depan:
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
- - test runner dan assertion utilities bawaan
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
- ## Ringkasnya
253
+ ## Backurus Workflow
355
254
 
356
- Backurus cocok dipamerkan sebagai framework backend Node.js yang:
255
+ A typical API workflow looks like this:
357
256
 
358
- - punya identitas sendiri
359
- - jelas target penggunanya
360
- - nyaman dipakai untuk bangun API
361
- - familiar untuk developer Laravel
362
- - sudah membawa banyak fitur penting tanpa setup berlapis
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
- Jika Anda ingin framework backend API yang cepat, readable, dan terasa familiar, Backurus punya arah yang kuat.
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 normal izePayload(body) {
5
+ function normalizePayload(body) {
6
6
  return {
7
7
  name: body.name,
8
8
  description: body.description || null,