Documentation
MockData serves fake REST resources as JSON. Use public resources freely, or hit Auth to practice login success/failure. Try live calls in the Playground. Production uses one shared database — see Shared data.
What's new
Features shipped for builders, newest first. Click a card to expand details. The same list is under the bell icon in the header.
- Each resource docs page has a Preview button that opens a tiny app on top of the real endpoints.
- List, search, paginate, create, edit, and delete rows — same shared demo database as everyone else.
- Auth preview includes a working login form (password is always password) and GET /me with the token.
- Use the header EN | FA toggle so preview lists load Persian sample data when you want it.
- English remains the default. Only the lang=fa query param switches text — no cookie or Accept-Language.
- FA responses include Content-Language: fa and a font object pointing at Vazirmatn for rendering.
- Works on list and detail routes, plus auth login with Persian overlay usernames.
- In the Playground, picking FA in the header appends lang=fa for you.
- Pick a resource and action, edit query params or JSON body, then send the request.
- Auth login has Correct / Wrong password presets so you can demo 200 vs 401 quickly.
- Responses show status, headers-friendly JSON, and pagination when the route returns it.
- Handy for teaching, screenshots, and checking filters without opening Postman.
- Every seeded user shares the mock password: password.
- Successful login returns a mock Bearer token and a user object (id, name, username, email, role).
- Wrong password or unknown username returns 401 with a clear error payload.
- Send Authorization: Bearer <token> to GET /api/auth/me to read the current user.
- Standard list shape: { data, pagination } with page, limit, total, and totalPages.
- Support for search, sort, filters, artificial delay, and forced error status query params.
- Shared production database resets daily — great for demos, not for permanent storage.
- Machine-readable catalog at /openapi.json for Postman, Swagger, and AI tools.
Language
All resource text is English by default. Pass lang=fa for Persian responses with Iranian names, usernames, emails, phones, and copy. No cookie or Accept-Language header is used — only the query param.
- Example:
GET /api/users?lang=fa - FA responses include
Content-Language: faand afontobject (Vazirmatn) for rendering. - Header EN | FA only adds
?lang=fain the Playground.
1// Persian (Iranian) names & copy — English is default2const res = await fetch('/api/users?limit=3&lang=fa');3const { data, font } = await res.json();4// font.cssUrl → Vazirmatn stylesheet for Persian text5console.log(data, font);1# Same with curl2curl "http://localhost:3000/api/users?limit=3&lang=fa"Resources
Live endpoints you can call today, plus a short roadmap of what is next.
| Resource | Base path | Status | Docs |
|---|---|---|---|
Auth Auth | /api/auth | Live | Open |
Users Users | /api/users | Live | Open |
Posts Content | /api/posts | Live | Open |
Comments Content | /api/comments | Live | Open |
Albums Media | /api/albums | Live | Open |
Photos Media | /api/photos | Live | Open |
Todos Productivity | /api/todos | Live | Open |
Products Commerce | /api/products | Live | Open |
Notifications Engagement | /api/notifications | Live | Open |
Countries Geo | /api/countries | Live | Open |
Orders Commerce | /api/orders | Coming soon | — |
OpenAPI
Machine-readable catalog of every live endpoint (Auth, Users, Posts, Comments, Albums, Photos, Todos, Products, Notifications, Countries, and Admin reset). Import into Postman, Swagger UI, or AI tools.
1# Import into Postman / Insomnia / Swagger2curl -O http://localhost:3000/openapi.jsonRequests
Lists return data + pagination. Single items return { data }.
1const res = await fetch('/api/posts?limit=6');2const { data, pagination } = await res.json();3console.log(data, pagination);Persian: append lang=fa. See Language.
Errors
Failures use an error object. Statuses: 400 validation, 401 unauthorized, 404 missing, 429 rate limited, 500 server. Pass ?status=500 (400–599) to force an error for UI demos.
1{2 "error": {3 "code": "NOT_FOUND",4 "message": "Post not found"5 }6}Rate limit
All /api/* routes allow about 60 requests per IP per minute. Responses include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. Over limit returns 429 with Retry-After.
1{2 "error": {3 "code": "RATE_LIMITED",4 "message": "Too many requests. Try again in 42s."5 }6}Reset seed
For an immediate reset, use the panel below with the admin secret. Production also resets automatically once per day (Shared data).
Enter the admin secret to wipe and reload default seed data.