phantomback 1.0.2 โ 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/README.md +153 -202
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,85 +1,76 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
+
<br />
|
|
4
|
+
|
|
3
5
|
# ๐ป PhantomBack
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
**Instant Fake Backend Generator with Smart Responses**
|
|
6
8
|
|
|
7
9
|
[](https://www.npmjs.com/package/phantomback)
|
|
10
|
+
[](https://www.npmjs.com/package/phantomback)
|
|
8
11
|
[](LICENSE)
|
|
9
12
|
[](package.json)
|
|
10
|
-
[](https://phantombackxdocs.vercel.app)
|
|
11
|
-
|
|
12
|
-
**Stop waiting for the backend. Start building now.**
|
|
13
|
-
|
|
14
|
-
Drop in your API schema โ get a fully functional REST server with realistic data,
|
|
15
|
-
JWT auth, pagination, filtering, sorting, search, and nested routes โ in seconds.
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
Stop waiting for the backend. Drop in your API schema โ get a fully functional REST server with
|
|
15
|
+
realistic data, JWT auth, pagination, filtering, sorting, search, and nested routes โ in seconds.
|
|
18
16
|
|
|
19
|
-
[Documentation](https://phantombackxdocs.vercel.app) ยท
|
|
17
|
+
[Documentation](https://phantombackxdocs.vercel.app) ยท
|
|
18
|
+
[Getting Started](https://phantombackxdocs.vercel.app/docs/getting-started) ยท
|
|
19
|
+
[API Reference](https://phantombackxdocs.vercel.app/docs/api-reference) ยท
|
|
20
|
+
[Playground](https://phantombackxdocs.vercel.app/docs/playground) ยท
|
|
21
|
+
[GitHub](https://github.com/madhavxchaturvedi/npm-phantomback)
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
<br />
|
|
22
24
|
|
|
23
25
|
</div>
|
|
24
26
|
|
|
25
27
|
---
|
|
26
28
|
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- ๐ **Relations & Nested Routes** โ `GET /users/:id/posts` auto-detected from foreign keys
|
|
37
|
-
- ๐ **JWT Auth** โ register, login, protected routes with Bearer tokens
|
|
38
|
-
- โฑ๏ธ **Response Delay** โ simulate slow networks with fixed or random latency
|
|
39
|
-
- โ
**Validation** โ required fields, type checks, unique constraints, email format
|
|
40
|
-
- ๐ฅ๏ธ **CLI + Library** โ use as a CLI tool or import in your code
|
|
41
|
-
- ๐ง **Smart Defaults** โ sensible conventions, override only what you need
|
|
29
|
+
## Why PhantomBack?
|
|
30
|
+
|
|
31
|
+
| Pain point | PhantomBack fix |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Backend not ready yet | Full REST API in one command |
|
|
34
|
+
| Static JSON mocks feel fake | Stateful CRUD with realistic Faker data |
|
|
35
|
+
| No pagination / filtering in mocks | Full query support out of the box |
|
|
36
|
+
| Auth testing is painful | JWT auth simulation built-in |
|
|
37
|
+
| Mock server setup takes time | One command or one line of code |
|
|
42
38
|
|
|
43
39
|
---
|
|
44
40
|
|
|
45
|
-
##
|
|
41
|
+
## Quick Start
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
# Global install (recommended for CLI)
|
|
49
|
-
npm install -g phantomback
|
|
43
|
+
### Install
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
npm install
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g phantomback # CLI (global)
|
|
47
|
+
npm install --save-dev phantomback # Library (project)
|
|
53
48
|
```
|
|
54
49
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
## ๐ Quick Start
|
|
58
|
-
|
|
59
|
-
### One command โ full API:
|
|
50
|
+
### Zero-config โ one command, full API
|
|
60
51
|
|
|
61
52
|
```bash
|
|
62
53
|
phantomback start --zero
|
|
63
54
|
```
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
- ๐ค 25 Users (protected with auth)
|
|
67
|
-
- ๐ 50 Posts
|
|
68
|
-
- ๐ฌ 100 Comments
|
|
69
|
-
- ๐ฆ 30 Products
|
|
70
|
-
- โ
40 Todos
|
|
56
|
+
You now have a REST API at **`http://localhost:3777`** with:
|
|
71
57
|
|
|
72
|
-
|
|
58
|
+
| Resource | Count | Auth |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| `/api/users` | 25 records | ๐ Protected |
|
|
61
|
+
| `/api/posts` | 50 records | โ |
|
|
62
|
+
| `/api/comments` | 100 records | โ |
|
|
63
|
+
| `/api/products` | 30 records | โ |
|
|
64
|
+
| `/api/todos` | 40 records | โ |
|
|
73
65
|
|
|
74
|
-
|
|
75
|
-
# Generate a starter config
|
|
76
|
-
phantomback init
|
|
66
|
+
### Or bring your own schema
|
|
77
67
|
|
|
78
|
-
|
|
79
|
-
phantomback
|
|
68
|
+
```bash
|
|
69
|
+
phantomback init # generates phantom.config.js
|
|
70
|
+
phantomback start # reads config and starts server
|
|
80
71
|
```
|
|
81
72
|
|
|
82
|
-
### Or as a library
|
|
73
|
+
### Or use as a library
|
|
83
74
|
|
|
84
75
|
```js
|
|
85
76
|
import { createPhantom } from 'phantomback';
|
|
@@ -100,10 +91,10 @@ const server = await createPhantom({
|
|
|
100
91
|
|
|
101
92
|
// server.stop() โ shut down
|
|
102
93
|
// server.reset() โ re-seed all data
|
|
103
|
-
// server.getStore() โ export current state
|
|
94
|
+
// server.getStore() โ export current state
|
|
104
95
|
```
|
|
105
96
|
|
|
106
|
-
One
|
|
97
|
+
One-liner for zero-config:
|
|
107
98
|
|
|
108
99
|
```js
|
|
109
100
|
import { createPhantomZero } from 'phantomback';
|
|
@@ -112,18 +103,16 @@ await createPhantomZero(); // Full demo API on port 3777
|
|
|
112
103
|
|
|
113
104
|
---
|
|
114
105
|
|
|
115
|
-
##
|
|
106
|
+
## Configuration
|
|
116
107
|
|
|
117
|
-
Create
|
|
108
|
+
Create **`phantom.config.js`** in your project root:
|
|
118
109
|
|
|
119
110
|
```js
|
|
120
111
|
export default {
|
|
121
112
|
port: 3777,
|
|
122
113
|
prefix: '/api',
|
|
123
|
-
|
|
124
|
-
//
|
|
125
|
-
// latency: 500,
|
|
126
|
-
// latency: [200, 800], // random range
|
|
114
|
+
// latency: 500, // fixed delay (ms)
|
|
115
|
+
// latency: [200, 800], // random range
|
|
127
116
|
|
|
128
117
|
auth: {
|
|
129
118
|
secret: 'my-secret-key',
|
|
@@ -133,23 +122,23 @@ export default {
|
|
|
133
122
|
resources: {
|
|
134
123
|
users: {
|
|
135
124
|
fields: {
|
|
136
|
-
name:
|
|
137
|
-
email:
|
|
138
|
-
age:
|
|
139
|
-
role:
|
|
140
|
-
avatar:
|
|
125
|
+
name: { type: 'name', required: true },
|
|
126
|
+
email: { type: 'email', unique: true },
|
|
127
|
+
age: { type: 'number', min: 18, max: 65 },
|
|
128
|
+
role: { type: 'enum', values: ['admin', 'user', 'moderator'] },
|
|
129
|
+
avatar: { type: 'avatar' },
|
|
141
130
|
isActive: { type: 'boolean' },
|
|
142
131
|
},
|
|
143
|
-
seed: 25,
|
|
132
|
+
seed: 25,
|
|
144
133
|
auth: true, // protect with JWT
|
|
145
134
|
},
|
|
146
135
|
|
|
147
136
|
posts: {
|
|
148
137
|
fields: {
|
|
149
|
-
title:
|
|
150
|
-
body:
|
|
138
|
+
title: { type: 'title', required: true },
|
|
139
|
+
body: { type: 'paragraphs', count: 3 },
|
|
151
140
|
userId: { type: 'relation', resource: 'users' },
|
|
152
|
-
views:
|
|
141
|
+
views: { type: 'number', min: 0, max: 10000 },
|
|
153
142
|
},
|
|
154
143
|
seed: 50,
|
|
155
144
|
},
|
|
@@ -157,43 +146,29 @@ export default {
|
|
|
157
146
|
};
|
|
158
147
|
```
|
|
159
148
|
|
|
160
|
-
|
|
149
|
+
> **Full config reference โ** [phantombackxdocs.vercel.app/docs/configuration](https://phantombackxdocs.vercel.app/docs/configuration)
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Supported Field Types
|
|
161
154
|
|
|
162
155
|
| Type | Generates | Options |
|
|
163
|
-
|
|
164
|
-
| `name`
|
|
165
|
-
| `
|
|
166
|
-
| `lastName` | Last name | โ |
|
|
167
|
-
| `username` | Username | โ |
|
|
168
|
-
| `email` | Email address | `unique: true` |
|
|
169
|
-
| `avatar` | Avatar URL | โ |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `name` `firstName` `lastName` `username` | Names | โ |
|
|
158
|
+
| `email` | Email | `unique` |
|
|
170
159
|
| `phone` | Phone number | โ |
|
|
171
|
-
| `
|
|
172
|
-
| `jobTitle` |
|
|
173
|
-
| `sentence` |
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `
|
|
178
|
-
| `
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
181
|
-
| `price` | Price string | โ |
|
|
182
|
-
| `rating` | 1.0 โ 5.0 | โ |
|
|
183
|
-
| `boolean` | true/false | โ |
|
|
184
|
-
| `date` | ISO date | โ |
|
|
185
|
-
| `pastDate` | Past date | โ |
|
|
186
|
-
| `futureDate` | Future date | โ |
|
|
187
|
-
| `url` | URL | โ |
|
|
188
|
-
| `image` | Image URL | โ |
|
|
189
|
-
| `color` | Color name | โ |
|
|
190
|
-
| `address` | Street address | โ |
|
|
191
|
-
| `city` | City name | โ |
|
|
192
|
-
| `country` | Country name | โ |
|
|
193
|
-
| `product` | Product name | โ |
|
|
194
|
-
| `company` | Company name | โ |
|
|
160
|
+
| `avatar` | Avatar URL | โ |
|
|
161
|
+
| `bio` `jobTitle` | Profile text | โ |
|
|
162
|
+
| `sentence` `paragraph` `paragraphs` | Text blocks | `count` |
|
|
163
|
+
| `title` `description` `slug` | Content | โ |
|
|
164
|
+
| `number` `float` `price` `rating` | Numbers | `min` `max` `precision` |
|
|
165
|
+
| `boolean` | true / false | โ |
|
|
166
|
+
| `date` `pastDate` `futureDate` | ISO dates | โ |
|
|
167
|
+
| `url` `image` `color` | Misc | โ |
|
|
168
|
+
| `address` `city` `country` | Location | โ |
|
|
169
|
+
| `product` `company` | Business | โ |
|
|
195
170
|
| `enum` | Random from list | `values: [...]` |
|
|
196
|
-
| `relation` | Foreign key | `resource: '
|
|
171
|
+
| `relation` | Foreign key | `resource: '...'` |
|
|
197
172
|
| `uuid` | UUID string | โ |
|
|
198
173
|
|
|
199
174
|
### Field Options
|
|
@@ -201,60 +176,81 @@ export default {
|
|
|
201
176
|
```js
|
|
202
177
|
{
|
|
203
178
|
type: 'email',
|
|
204
|
-
required: true, //
|
|
205
|
-
unique: true, //
|
|
206
|
-
min: 0, //
|
|
207
|
-
max: 100, //
|
|
179
|
+
required: true, // must be present on create
|
|
180
|
+
unique: true, // no duplicates allowed
|
|
181
|
+
min: 0, // number minimum
|
|
182
|
+
max: 100, // number maximum
|
|
208
183
|
}
|
|
209
184
|
```
|
|
210
185
|
|
|
211
186
|
---
|
|
212
187
|
|
|
213
|
-
##
|
|
188
|
+
## Auto-Generated Routes
|
|
214
189
|
|
|
215
|
-
|
|
190
|
+
Every resource gets full CRUD automatically:
|
|
216
191
|
|
|
217
192
|
| Method | Endpoint | Description |
|
|
218
|
-
|
|
193
|
+
|---|---|---|
|
|
219
194
|
| `GET` | `/api/users` | List all (paginated) |
|
|
220
|
-
| `GET` | `/api/users/:id` | Get one
|
|
221
|
-
| `POST` | `/api/users` | Create
|
|
195
|
+
| `GET` | `/api/users/:id` | Get one |
|
|
196
|
+
| `POST` | `/api/users` | Create |
|
|
222
197
|
| `PUT` | `/api/users/:id` | Full update |
|
|
223
198
|
| `PATCH` | `/api/users/:id` | Partial update |
|
|
224
199
|
| `DELETE` | `/api/users/:id` | Delete |
|
|
225
200
|
|
|
226
|
-
### Nested Routes
|
|
201
|
+
### Nested Routes
|
|
227
202
|
|
|
228
|
-
If `posts` has `userId: { type: 'relation', resource: 'users' }`, you get:
|
|
203
|
+
If `posts` has `userId: { type: 'relation', resource: 'users' }`, you automatically get:
|
|
229
204
|
|
|
230
205
|
```
|
|
231
|
-
GET /api/users/:id/posts
|
|
206
|
+
GET /api/users/:id/posts โ all posts by this user
|
|
232
207
|
```
|
|
233
208
|
|
|
234
209
|
### Special Routes
|
|
235
210
|
|
|
236
211
|
| Method | Endpoint | Description |
|
|
237
|
-
|
|
212
|
+
|---|---|---|
|
|
238
213
|
| `GET` | `/api` | List all endpoints |
|
|
239
|
-
| `GET` | `/api/_health` |
|
|
240
|
-
| `POST` | `/api/auth/register` | Register
|
|
241
|
-
| `POST` | `/api/auth/login` | Login
|
|
242
|
-
| `GET` | `/api/auth/me` | Current user (
|
|
214
|
+
| `GET` | `/api/_health` | Health check |
|
|
215
|
+
| `POST` | `/api/auth/register` | Register |
|
|
216
|
+
| `POST` | `/api/auth/login` | Login โ JWT |
|
|
217
|
+
| `GET` | `/api/auth/me` | Current user (token required) |
|
|
243
218
|
|
|
244
219
|
---
|
|
245
220
|
|
|
246
|
-
##
|
|
247
|
-
|
|
248
|
-
### Pagination
|
|
221
|
+
## Query Parameters
|
|
249
222
|
|
|
250
223
|
```bash
|
|
224
|
+
# Pagination
|
|
251
225
|
GET /api/users?page=2&limit=10
|
|
252
226
|
GET /api/users?offset=20&limit=10
|
|
227
|
+
|
|
228
|
+
# Filtering
|
|
229
|
+
GET /api/users?role=admin # exact match
|
|
230
|
+
GET /api/users?age_gte=18 # โฅ
|
|
231
|
+
GET /api/users?age_lte=30 # โค
|
|
232
|
+
GET /api/users?age_gt=18&age_lt=30 # range
|
|
233
|
+
GET /api/users?role_ne=admin # not equal
|
|
234
|
+
GET /api/users?name_like=john # contains
|
|
235
|
+
|
|
236
|
+
# Sorting
|
|
237
|
+
GET /api/users?sort=name # ascending
|
|
238
|
+
GET /api/users?sort=-name # descending
|
|
239
|
+
GET /api/users?sort=role,-age # multi-field
|
|
240
|
+
|
|
241
|
+
# Search
|
|
242
|
+
GET /api/users?q=john # full-text across all fields
|
|
243
|
+
|
|
244
|
+
# Field Selection
|
|
245
|
+
GET /api/users?fields=name,email,role
|
|
253
246
|
```
|
|
254
247
|
|
|
255
|
-
Response includes:
|
|
248
|
+
Response includes pagination metadata:
|
|
249
|
+
|
|
256
250
|
```json
|
|
257
251
|
{
|
|
252
|
+
"success": true,
|
|
253
|
+
"data": [ ... ],
|
|
258
254
|
"meta": {
|
|
259
255
|
"page": 2,
|
|
260
256
|
"limit": 10,
|
|
@@ -266,91 +262,47 @@ Response includes:
|
|
|
266
262
|
}
|
|
267
263
|
```
|
|
268
264
|
|
|
269
|
-
### Filtering
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
GET /api/users?role=admin # exact match
|
|
273
|
-
GET /api/users?age_gte=18 # greater than or equal
|
|
274
|
-
GET /api/users?age_lte=30 # less than or equal
|
|
275
|
-
GET /api/users?age_gt=18 # greater than
|
|
276
|
-
GET /api/users?age_lt=30 # less than
|
|
277
|
-
GET /api/users?role_ne=admin # not equal
|
|
278
|
-
GET /api/users?name_like=john # contains (case-insensitive)
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
### Sorting
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
GET /api/users?sort=name # ascending
|
|
285
|
-
GET /api/users?sort=-name # descending
|
|
286
|
-
GET /api/users?sort=role,-age # multi-field
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
### Search
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
GET /api/users?q=john # search across all fields
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
### Field Selection
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
GET /api/users?fields=name,email,role # only return these fields
|
|
299
|
-
```
|
|
300
|
-
|
|
301
265
|
---
|
|
302
266
|
|
|
303
|
-
##
|
|
267
|
+
## Authentication
|
|
304
268
|
|
|
305
|
-
1. **Register:**
|
|
306
269
|
```bash
|
|
270
|
+
# 1. Register
|
|
307
271
|
curl -X POST http://localhost:3777/api/auth/register \
|
|
308
272
|
-H "Content-Type: application/json" \
|
|
309
|
-
-d '{"email": "user@
|
|
310
|
-
```
|
|
273
|
+
-d '{"email": "user@test.com", "password": "secret123", "name": "John"}'
|
|
311
274
|
|
|
312
|
-
2.
|
|
313
|
-
```bash
|
|
275
|
+
# 2. Login
|
|
314
276
|
curl -X POST http://localhost:3777/api/auth/login \
|
|
315
277
|
-H "Content-Type: application/json" \
|
|
316
|
-
-d '{"email": "user@
|
|
317
|
-
```
|
|
278
|
+
-d '{"email": "user@test.com", "password": "secret123"}'
|
|
318
279
|
|
|
319
|
-
3.
|
|
320
|
-
```bash
|
|
280
|
+
# 3. Use the token
|
|
321
281
|
curl http://localhost:3777/api/users \
|
|
322
282
|
-H "Authorization: Bearer <your-token>"
|
|
323
283
|
```
|
|
324
284
|
|
|
325
285
|
---
|
|
326
286
|
|
|
327
|
-
##
|
|
287
|
+
## CLI Reference
|
|
328
288
|
|
|
329
289
|
```bash
|
|
330
|
-
#
|
|
331
|
-
phantomback start
|
|
332
|
-
|
|
333
|
-
# Start with zero-config (demo mode)
|
|
334
|
-
phantomback start --zero
|
|
335
|
-
|
|
336
|
-
# Custom port
|
|
337
|
-
phantomback start --port 4000
|
|
338
|
-
|
|
339
|
-
# Specific config file
|
|
290
|
+
phantomback start # start with phantom.config.js
|
|
291
|
+
phantomback start --zero # zero-config demo mode
|
|
292
|
+
phantomback start --port 4000 # custom port
|
|
340
293
|
phantomback start --config ./my-api.config.js
|
|
341
|
-
|
|
342
|
-
# Generate starter config
|
|
343
|
-
phantomback init
|
|
344
|
-
|
|
345
|
-
# Show help
|
|
294
|
+
phantomback init # generate starter config
|
|
346
295
|
phantomback --help
|
|
347
296
|
```
|
|
348
297
|
|
|
298
|
+
> **Full CLI docs โ** [phantombackxdocs.vercel.app/docs/cli](https://phantombackxdocs.vercel.app/docs/cli)
|
|
299
|
+
|
|
349
300
|
---
|
|
350
301
|
|
|
351
|
-
##
|
|
302
|
+
## Real-World Examples
|
|
352
303
|
|
|
353
|
-
|
|
304
|
+
<details>
|
|
305
|
+
<summary><strong>๐ฅ Hospital Management</strong></summary>
|
|
354
306
|
|
|
355
307
|
```js
|
|
356
308
|
export default {
|
|
@@ -376,8 +328,10 @@ export default {
|
|
|
376
328
|
},
|
|
377
329
|
};
|
|
378
330
|
```
|
|
331
|
+
</details>
|
|
379
332
|
|
|
380
|
-
|
|
333
|
+
<details>
|
|
334
|
+
<summary><strong>๐ E-Commerce</strong></summary>
|
|
381
335
|
|
|
382
336
|
```js
|
|
383
337
|
export default {
|
|
@@ -403,12 +357,13 @@ export default {
|
|
|
403
357
|
},
|
|
404
358
|
};
|
|
405
359
|
```
|
|
360
|
+
</details>
|
|
406
361
|
|
|
407
|
-
|
|
362
|
+
> **More examples โ** [phantombackxdocs.vercel.app/docs/examples](https://phantombackxdocs.vercel.app/docs/examples)
|
|
408
363
|
|
|
409
|
-
|
|
364
|
+
---
|
|
410
365
|
|
|
411
|
-
|
|
366
|
+
## Response Format
|
|
412
367
|
|
|
413
368
|
**Success:**
|
|
414
369
|
```json
|
|
@@ -423,10 +378,7 @@ All responses follow a consistent format:
|
|
|
423
378
|
```json
|
|
424
379
|
{
|
|
425
380
|
"success": false,
|
|
426
|
-
"error": {
|
|
427
|
-
"status": 404,
|
|
428
|
-
"message": "users with id \"abc\" not found"
|
|
429
|
-
}
|
|
381
|
+
"error": { "status": 404, "message": "users with id \"abc\" not found" }
|
|
430
382
|
}
|
|
431
383
|
```
|
|
432
384
|
|
|
@@ -437,28 +389,27 @@ All responses follow a consistent format:
|
|
|
437
389
|
"error": {
|
|
438
390
|
"status": 400,
|
|
439
391
|
"message": "Validation failed",
|
|
440
|
-
"details": [
|
|
441
|
-
{ "field": "email", "message": "\"email\" is required" }
|
|
442
|
-
]
|
|
392
|
+
"details": [{ "field": "email", "message": "\"email\" is required" }]
|
|
443
393
|
}
|
|
444
394
|
}
|
|
445
395
|
```
|
|
446
396
|
|
|
447
397
|
---
|
|
448
398
|
|
|
449
|
-
##
|
|
399
|
+
## License
|
|
450
400
|
|
|
451
|
-
|
|
452
|
-
|---------|---------------------|
|
|
453
|
-
| Backend not ready yet | Start frontend dev instantly |
|
|
454
|
-
| Static JSON mocks are unrealistic | Stateful CRUD with realistic Faker data |
|
|
455
|
-
| No pagination/filtering in mocks | Full query support out of the box |
|
|
456
|
-
| Auth testing is painful | JWT auth simulation built-in |
|
|
457
|
-
| Setting up mock servers takes time | One command / one line of code |
|
|
458
|
-
| Different projects need different schemas | Define any resource with a config file |
|
|
401
|
+
MIT ยฉ [Madhav Chaturvedi](https://github.com/madhavxchaturvedi)
|
|
459
402
|
|
|
460
403
|
---
|
|
461
404
|
|
|
462
|
-
|
|
405
|
+
<div align="center">
|
|
406
|
+
|
|
407
|
+
[Documentation](https://phantombackxdocs.vercel.app) ยท
|
|
408
|
+
[npm](https://www.npmjs.com/package/phantomback) ยท
|
|
409
|
+
[GitHub](https://github.com/madhavxchaturvedi/npm-phantomback) ยท
|
|
410
|
+
[CLI Reference](https://phantombackxdocs.vercel.app/docs/cli) ยท
|
|
411
|
+
[Playground](https://phantombackxdocs.vercel.app/docs/playground)
|
|
463
412
|
|
|
464
|
-
|
|
413
|
+
Made with โค๏ธ by [Madhav Chaturvedi](https://madhavxchaturvedi.vercel.app) ยท [LinkedIn](https://www.linkedin.com/in/madhavxchaturvedi/) ยท [Instagram](https://www.instagram.com/madhavxchaturvedi)
|
|
414
|
+
|
|
415
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phantomback",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Instant fake backend generator with smart responses & chaos engineering. Drop in your API schema โ get a fully functional, stateful REST server with realistic data, auth, pagination, filtering, and Reality Mode for chaos testing.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|