{"id":16552091,"url":"https://github.com/woliveiras/json-server-template","last_synced_at":"2026-02-07T18:32:03.988Z","repository":{"id":224693311,"uuid":"763581829","full_name":"woliveiras/json-server-template","owner":"woliveiras","description":"Vitejs and React starting template using Git Hooks, Vitest, and Vitest UI, react-testing-library and json-server.","archived":false,"fork":false,"pushed_at":"2024-05-27T08:47:27.000Z","size":620,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T13:48:16.011Z","etag":null,"topics":["vite","vite-react","vite-react-ts","vite-react-typescript","vite-template","vite-template-react","vitejs","vitejs-react","vitejs-react-typescript"],"latest_commit_sha":null,"homepage":"","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/woliveiras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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},"funding":{"github":"woliveiras","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2024-02-26T15:06:05.000Z","updated_at":"2024-07-01T13:28:29.000Z","dependencies_parsed_at":"2024-02-27T10:26:28.886Z","dependency_job_id":"b822b072-5ffa-46ad-bb45-6b93a5560959","html_url":"https://github.com/woliveiras/json-server-template","commit_stats":null,"previous_names":["woliveiras/json-server-template"],"tags_count":0,"template":true,"template_full_name":"woliveiras/vite-react-template","purl":"pkg:github/woliveiras/json-server-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fjson-server-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fjson-server-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fjson-server-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fjson-server-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woliveiras","download_url":"https://codeload.github.com/woliveiras/json-server-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woliveiras%2Fjson-server-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29203782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["vite","vite-react","vite-react-ts","vite-react-typescript","vite-template","vite-template-react","vitejs","vitejs-react","vitejs-react-typescript"],"created_at":"2024-10-11T19:43:55.580Z","updated_at":"2026-02-07T18:32:03.965Z","avatar_url":"https://github.com/woliveiras.png","language":"TypeScript","funding_links":["https://github.com/sponsors/woliveiras"],"categories":[],"sub_categories":[],"readme":"# json-server-template\n\nVitejs and React starting template using Git Hooks, Vitest, and Vitest UI, react-testing-library and json-server.\n\n## \u003ca name='ReactVitejson-server'\u003e\u003c/a\u003eReact, Vite + json-server\n\nThis template provides a minimal setup to get React working in Vite with HMR and some ESLint rules using the json-server as mock server to work with XHR.\n\nBased on [woliveiras/vite-react-template](https://github.com/woliveiras/vite-react-template).\n\nMaybe you will need help to create some GitHub Actions or another .github configuration. So, you can check my other template for it: [woliveiras/.github](https://github.com/woliveiras/.github)\n\n---\n\n**Table of Contents**\n\n\u003c!-- vscode-markdown-toc --\u003e\n\n- [React, Vite + json-server](#ReactVitejson-server)\n- [How to use this template](#Howtousethistemplate)\n- [How to run this project](#Howtorunthisproject)\n- [Available Endpoints](#AvailableEndpoints)\n- [Running the tests](#Runningthetests)\n- [Watching tests in UI mode](#WatchingtestsinUImode)\n\n\u003c!-- vscode-markdown-toc-config\n\tnumbering=false\n\tautoSave=true\n\t/vscode-markdown-toc-config --\u003e\n\u003c!-- /vscode-markdown-toc --\u003e\n\n## \u003ca name='Howtousethistemplate'\u003e\u003c/a\u003eHow to use this template\n\nYou just need to click on the button `Use this template` close to the reppo stars (remember to give me a star to make me happy) and start a new repo or open it in code space.\n\n**It would be good if you knew this before starting**\n\nWe are using:\n\n- [Husky](https://typicode.github.io/husky/) to run the Git Hooks;\n- [NVM](https://github.com/nvm-sh/nvm) to handle the Node versions;\n\nYou can update environment variables in the files:\n\n- [.env](./.env): the base env vile, the variables here will be used in all environments\n- [.env.development](./.env): the development mode, just read in your local environment (npm run dev)\n- [.env.production](./.env): the production mode, will be read in your production environment (npm run build)\n\nAnd you can create new variables with the prefix `VITE_`.\n\nExample: `VITE_EXAMPLE_VAR`.\n\nIn the [App.tsx](./src/App.tsx) you can see the use of `import.meta.env` to import env variables.\n\n## \u003ca name='Howtorunthisproject'\u003e\u003c/a\u003eHow to run this project\n\nFirst of all, let's configure our enviroment.\n\nYou will need NVM installed on your environment. So, get the latest version here: [nvm-sh/nvm](https://github.com/nvm-sh/nvm)\n\nInstall the `.nvmrc` Node version with the following command:\n\n```sh\nnvm install\n```\n\nAfter that, you can use it with:\n\n```sh\nnvm use\n```\n\nNow, we can install the application dependencies and start our dev-server with the commands below:\n\n```sh\nnpm i\nnpm run dev\n```\n\nSeed the DB with the following command:\n\n```sh\nnpm run seed-db\n```\n\nRun the server:\n\n```sh\nnpm run server\n```\n\n## \u003ca name='AvailableEndpoints'\u003e\u003c/a\u003eAvailable Endpoints\n\nYou can use the mock server with the endpoints:\n\n`GET all`: http://localhost:4002/companies/\n`GET one`: http://localhost:4002/companies/\u003cCompany_ID\u003e\n`GET specific`: http://localhost:4002/companies?company=Doylly\n\n`POST with body params`: http://localhost:4002/companies/\n`POST with URL params`: http://localhost:4002/companies?id=0101010\u0026company=Test\n\n`PATCH with body params`: http://localhost:4002/companies/\n`PATCH with URL params`: http://localhost:4002/companies?id=0101010\u0026company=Test\n\n`DELETE one`: http://localhost:4002/companies/\u003cCompany_ID\u003e\n\n## \u003ca name='Runningthetests'\u003e\u003c/a\u003eRunning the tests\n\nRunning all tests:\n\n```sh\nnpm t\n```\n\nWatching all tests:\n\n```sh\nnpm run test:watch\n```\n\nTo watch one file, you just need to add the path in the watch command:\n\n```sh\nnpm run test:watch src/components/Example/Example.test.tsx\n```\n\nTo run the coverage, you just need this command:\n\n```sh\nnpm run coverage\n```\n\n## \u003ca name='WatchingtestsinUImode'\u003e\u003c/a\u003eWatching tests in UI mode\n\nIf you don't know, we can use a UI to run our tests and check dependency graph like the following screenshots.\n\nYou just need to run the command:\n\n```sh\nnpm run test:ui\n```\n\n| Screenshots                                                        |\n| ------------------------------------------------------------------ |\n| ![Vitest UI Dashboard](.github/doc/img/vites-ui-dashboard.png)     |\n| ![Vitest UI Test File](.github/doc/img/vitest-ui-test-file.png)    |\n| ![Vitest UI Dependency Graph](.github/doc/img/vitest-ui-graph.png) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoliveiras%2Fjson-server-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoliveiras%2Fjson-server-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoliveiras%2Fjson-server-template/lists"}