{"id":26641664,"url":"https://github.com/omar-dulaimi/prisma-json-server-generator","last_synced_at":"2025-04-10T21:11:44.013Z","repository":{"id":57688283,"uuid":"492343792","full_name":"omar-dulaimi/prisma-json-server-generator","owner":"omar-dulaimi","description":"Prisma 2+ generator to emit a JSON file that can be run with json-server","archived":false,"fork":false,"pushed_at":"2024-04-11T17:44:25.000Z","size":328,"stargazers_count":26,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T21:11:42.561Z","etag":null,"topics":["json-server","prisma","prisma-generator"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omar-dulaimi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"omar-dulaimi","custom":["https://www.buymeacoffee.com/omardulaimi"]}},"created_at":"2022-05-14T23:13:11.000Z","updated_at":"2024-05-23T16:38:42.000Z","dependencies_parsed_at":"2025-03-24T18:38:28.360Z","dependency_job_id":"4115b60e-d7d9-4e79-96dc-98bdb102b4ce","html_url":"https://github.com/omar-dulaimi/prisma-json-server-generator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-json-server-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-json-server-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-json-server-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-json-server-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omar-dulaimi","download_url":"https://codeload.github.com/omar-dulaimi/prisma-json-server-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248298317,"owners_count":21080320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-server","prisma","prisma-generator"],"created_at":"2025-03-24T18:34:50.876Z","updated_at":"2025-04-10T21:11:43.982Z","avatar_url":"https://github.com/omar-dulaimi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/omar-dulaimi","https://www.buymeacoffee.com/omardulaimi"],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/prisma-json-server-generator.svg)](https://badge.fury.io/js/prisma-json-server-generator)\n[![npm](https://img.shields.io/npm/dt/prisma-json-server-generator.svg)](https://www.npmjs.com/package/prisma-json-server-generator)\n[![HitCount](https://hits.dwyl.com/omar-dulaimi/prisma-json-server-generator.svg?style=flat)](http://hits.dwyl.com/omar-dulaimi/prisma-json-server-generator)\n[![npm](https://img.shields.io/npm/l/prisma-json-server-generator.svg)](LICENSE)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/omar-dulaimi/prisma-json-server-generator\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/omar-dulaimi/prisma-json-server-generator/master/logo.png\" alt=\"Logo\" width=\"120\" height=\"120\"\u003e\n  \u003c/a\u003e\n  \u003ch3 align=\"center\"\u003ePrisma JSON Server Generator\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    A Prisma generator that automates creating a JSON file that can be run as a server from your Prisma schema.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/omar-dulaimi/prisma-json-server-generator#additional-options\"\u003e\u003cstrong\u003eExplore the options »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/omar-dulaimi/prisma-json-server-generator/issues/new?template=bug_report.yml\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/omar-dulaimi/prisma-json-server-generator/issues/new?template=feature_request.md\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/omardulaimi\"\u003e\n    \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-black.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [About The Project](#about-the-project)\n- [Supported Prisma Versions](#supported-prisma-versions)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Additional Options](#additional-options)\n- [Community](#community)\n- [Acknowledgement](#acknowledgement)\n\n# About The Project\n\nAutomatically generate a JSON file that can be run as a server from your [Prisma](https://github.com/prisma/prisma) Schema. Updates every time `npx prisma generate` runs.\n\n# Supported Prisma Versions\n\nProbably no breaking changes for this library, so try newer versions first.\n\n### Prisma 4\n\n- 0.2.0 and higher\n\n### Prisma 2/3\n\n- 0.1.2 and lower\n\n# Installation\n\nUsing npm:\n\n```bash\n npm install prisma-json-server-generator\n```\n\nUsing yarn:\n\n```bash\n yarn add prisma-json-server-generator\n```\n\n# Usage\n\n1- Star this repo 😉\n\n2- Add the generator to your Prisma schema\n\n```prisma\ngenerator json_server {\n  provider       = \"prisma-json-server-generator\"\n  outputFileName = \"db.json\"\n}\n```\n\n3- Install `json-server`\n\n```bash\nnpm install -g json-server\n```\n\n4- Run `npx prisma generate` for the following schema.prisma, or your schema\n\n```prisma\nmodel User {\n  id    Int     @id @default(autoincrement())\n  email String  @unique\n  name  String?\n  posts Post[]\n}\n\nmodel Post {\n  id        Int      @id @default(autoincrement())\n  createdAt DateTime @default(now())\n  updatedAt DateTime @updatedAt\n  title     String\n  content   String?\n  published Boolean  @default(false)\n  viewCount Int      @default(0)\n  author    User?    @relation(fields: [authorId], references: [id])\n  authorId  Int?\n}\n```\n\n5- Now you're ready to run your JSON server!\n\n```bash\njson-server --watch db.json\n```\n\n![JSON Server Running](https://raw.githubusercontent.com/omar-dulaimi/prisma-json-server-generator/master/jsonServerRunning.png)\n\n# Additional Options\n\n| Option           |  Description                                        | Type     |  Default      |\n| ---------------- | --------------------------------------------------- | -------- | ------------- |\n| `output`         | Output directory for the generated JSON server file | `string` | `./generated` |\n| `outputFileName` | JSON output file name                               | `string` | `db.json`     |\n\nUse additional options in the `schema.prisma`\n\n```prisma\ngenerator json_server {\n  provider       = \"prisma-json-server-generator\"\n  output         = \"./json-server\"\n}\n```\n\n# Community\n\n[![Stargazers repo roster for @omar-dulaimi/prisma-json-server-generator](https://reporoster.com/stars/omar-dulaimi/prisma-json-server-generator)](https://github.com/omar-dulaimi/prisma-json-server-generator/stargazers)\n\n# Acknowledgement\n\nSource of one of the icons used in making the logo: \u003ca href=\"https://www.flaticon.com/free-icons/json\" title=\"json icons\"\u003eJson icons created by Smashicons - Flaticon\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomar-dulaimi%2Fprisma-json-server-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomar-dulaimi%2Fprisma-json-server-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomar-dulaimi%2Fprisma-json-server-generator/lists"}