{"id":20333915,"url":"https://github.com/ray-d-song/faker-server","last_synced_at":"2025-04-05T15:02:45.986Z","repository":{"id":257817342,"uuid":"869434358","full_name":"Ray-D-Song/faker-server","owner":"Ray-D-Song","description":"Mock server based on faker.js with a web interface. 基于 Faker.js 的 mock 服务器，包含客户端管理界面。","archived":false,"fork":false,"pushed_at":"2024-10-21T08:19:51.000Z","size":1525,"stargazers_count":130,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T18:41:12.661Z","etag":null,"topics":["fakerjs","mock","mock-server","nodejs","self-hosted"],"latest_commit_sha":null,"homepage":"https://github.com/Ray-D-Song/faker-server","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ray-D-Song.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-10-08T09:38:48.000Z","updated_at":"2025-01-17T10:03:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9d1a009-68da-4877-83fb-187c9fda8eba","html_url":"https://github.com/Ray-D-Song/faker-server","commit_stats":null,"previous_names":["ray-d-song/faker-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ray-D-Song%2Ffaker-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ray-D-Song%2Ffaker-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ray-D-Song%2Ffaker-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ray-D-Song%2Ffaker-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ray-D-Song","download_url":"https://codeload.github.com/Ray-D-Song/faker-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234885,"owners_count":20905852,"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":["fakerjs","mock","mock-server","nodejs","self-hosted"],"created_at":"2024-11-14T20:35:18.601Z","updated_at":"2025-04-05T15:02:45.966Z","avatar_url":"https://github.com/Ray-D-Song.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Directory\n\n- [简体中文](https://github.com/ray-d-song/faker-server/blob/main/docs/zh_CN/README.zhCN.md)\n- [English](https://github.com/ray-d-song/faker-server/blob/main/README.md)\n\n## Faker Server\n\nFaker Server is a mock server based on Faker.js. It can be used to generate mock data for development and testing.\n\n![Faker Server](https://raw.githubusercontent.com/ray-d-song/faker-server/main/docs/static/preview.png)\n\nOnline access: [https://faker-preview.jenrays.com/](https://faker-preview.jenrays.com/)  \nRead-only key: `1234`\n\nMock API list:\n\n- [`GET /mock/user/list`](https://faker-preview.jenrays.com/mock/user/list)\n- [`POST /mock/user`](https://faker-preview.jenrays.com/mock/user)\n\n## Deploy\n\nCurrently supports npm command and Docker deployment.\n\nFirst, you need a MongoDB database and obtain the connection string. We recommend using MongoDB Atlas, but you can also deploy it yourself.\n\nMongoDB Atlas usage method can be found [here](https://github.com/ray-d-song/faker-server/blob/main/docs/en/mongodb-atlas.md).\n\n### npm command\n\n```bash\n# Install\nnpm install -g @ray-d-song/faker-server\n# Start\nfaker-server\n```\n\nThe program will generate a configuration file `.env` in your `~/.faker-server` directory. You can modify the configuration and restart the service as needed.\n\n```bash\n# Server Port\nPORT=3000\n\n# Access /mock/* API\nACCESS_KEY=${uuid}\n\n# If true, the server will allow public access to the /mock/* API\n# /api/* will continue to require authentication\nPUBLIC_ACCESS=false\n\n# ADMIN_KEY is used to access the web page and modify the data\nADMIN_KEY=${uuid}\n\n# READONLY_KEY can access the web page, but cannot modify the data\nREADONLY_KEY=${uuid}\n\n# MongoDB URL\nMONGO_URL=mongodb://admin:password@localhost:27017?authSource=admin\n```\n\n`ACCESS_KEY` `ADMIN_KEY` `READONLY_KEY` are randomly generated when the service is first started. You can also modify them as needed.\n\n`ACCESS_KEY` is used to access the mock service.  \n`ADMIN_KEY` is used to manage the interface in the page.  \n`READONLY_KEY` can access the web page, but cannot modify the data.\n\n`PUBLIC_ACCESS` is true, the mock service will allow public access, but the `/api/*` interface for editing will still require authentication.\n\n### Docker\n\n🚧 Under Construction\n\n## Access Service\n\n### web page\n\nIf your service is running on `http://localhost:3000`, then the web page can be accessed through `http://localhost:3000`.\n\nThe page will prompt you to enter `ADMIN_KEY` or `READONLY_KEY`.\n\n### mock service\n\nThe mock service interface address is `/mock/*`, for example, if you add an interface `/user/list`, you can access it through `http://localhost:3000/mock/user/list`.\n\nWhen `PUBLIC_ACCESS` is set to false, accessing the interface requires the `Faker-Server-Key` request header, the value is the `ACCESS_KEY` in the `.env` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fray-d-song%2Ffaker-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fray-d-song%2Ffaker-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fray-d-song%2Ffaker-server/lists"}