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