{"id":21240604,"url":"https://github.com/chrisnajman/react-router-tutorial","last_synced_at":"2026-04-11T11:36:55.901Z","repository":{"id":231309900,"uuid":"781448160","full_name":"chrisnajman/react-router-tutorial","owner":"chrisnajman","description":"A contacts demo built from the React Router tutorial - link in the README.md","archived":false,"fork":false,"pushed_at":"2025-02-25T19:59:51.000Z","size":447,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T20:37:34.650Z","etag":null,"topics":["react","react-router","vitejs"],"latest_commit_sha":null,"homepage":"https://chrisnajman.github.io/react-router-tutorial/","language":"JavaScript","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/chrisnajman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-04-03T12:01:38.000Z","updated_at":"2025-02-25T19:59:27.000Z","dependencies_parsed_at":"2024-09-18T07:36:31.508Z","dependency_job_id":"5fbceaf2-31a0-429c-bc8c-fa0d7bb48c16","html_url":"https://github.com/chrisnajman/react-router-tutorial","commit_stats":null,"previous_names":["chrisnajman/react-router-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Freact-router-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Freact-router-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Freact-router-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Freact-router-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisnajman","download_url":"https://codeload.github.com/chrisnajman/react-router-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681004,"owners_count":20330155,"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":["react","react-router","vitejs"],"created_at":"2024-11-21T00:52:04.993Z","updated_at":"2026-04-11T11:36:50.882Z","avatar_url":"https://github.com/chrisnajman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Router Tutorial\n\n- [Tutorial URL](https://reactrouter.com/en/main/start/tutorial)\n\n\u003e [!NOTE]\n\u003e The tutorial files were modified to be deployable to Git Pages (see [Configuring the Git Repo](#installation-and-configuring-the-git-repo), below).\n\n## My additions\n\n### CSS\n\n- I moved the `h1` back to the top of the sidebar by removing `order: 1` from the rule.\n- I added and styled a `footer` section in the sidebar to contain the Git Repository link and the 'Delete all contacts' button.\n- I also added some **basic** responsive styling so that horizontal scrollbars don't occur on mobile devices.\n\n### Delete All Button\n\nI created a new component: `DeleteAllButton.jsx` in `/src`. The component is inserted into the `footer` in `/src/routes/Root.jsx`.\n\nThis button clears all key pairs from the Chrome console: `Application \u003e IndexedDB \u003e localforage \u003e keyvaluepairs`, thus deleting all contacts.\n\n\u003e [!NOTE]\n\u003e Clicking this button launches a confirm dialog, so you have the option of changing your mind (by cancelling the operation).\n\n\u003e [!TIP]\n\u003e If you leave the console open after clearing contacts, the deleted contacts might still appear in the 'key/value' window. Furthermore, you might see a warning 'Data may be stale' at the top of the window. To update the 'key/value' pairs window, click the 'refresh' icon and the data will disappear.\n\n### Contact Avatar\n\nI replaced the existing tutorial code with the following:\n\n```jsx\n\u003cdiv className=\"avatar\"\u003e\n  {contact.avatar ? (\n    \u003cimg\n      key={contact.avatar}\n      src={contact.avatar || null}\n      alt={`${contact.first} ${contact.last}`}\n      width=\"192\"\n      height=\"192\"\n    /\u003e\n  ) : (\n    \u003cp\u003eNo avatar uploaded\u003c/p\u003e\n  )}\n\u003c/div\u003e\n```\n\n## Installation\n\n- Download / clone\n- `npm install` to install `node_modules`\n- in progress...\n\n## Installation and Configuring the Git Repo\n\n### Installation\n\n- In a terminal window, navigate and enter the the project folder.\n- `npm install` to install `node_modules`.\n\n#### Renaming the project\n\n- Do a project-wide search for `/react-router-tutorial/`.\n- Replace with `/name-of-your-project/`.\n- In `package.json`,\n  - change `\"name\"` to `\"name-of-your-project\"`.\n  - Change the `\"homepage\"` url to `\"https://[your-user-name].github.io/[name-of-your-project]\"`.\n\n#### Viewing the project\n\n- Type `npm run dev` in the terminal and press `Enter` to get the local host url where you can view the project.\n\n### Configuring the Git Repo\n\nOnce you've created a Git repository and pushed your files, you can visit the following pages to get detailed instructions.\n\n- For all installation and configuration instructions see [\"vite-react-router\" (Github repo) by Erick Kuwahara](https://github.com/ErickKS/vite-react-router/tree/main).\n\n- You can also watch his step-by-step YouTube tutorial: [Vite React App with Routes Deployed on Github | Reload error resolved!](https://youtu.be/uEEj2c3_ydg).\n\nHowever, the instructions can be boiled down to the following:\n\n- Settings -\u003e Actions -\u003e General -\u003e Workflow permissions -\u003e Click: Read and Write permissions -\u003e Save.\n- Actions -\u003e failed deploy -\u003e re-run-job failed jobs.\n- Settings -\u003e Pages -\u003e Branch -\u003e gh-pages -\u003e save.\n\nYou can then click on 'Actions' in the main navigation, and watch the site being deployed. At the end of deployment you will see a link to the GH pages website.\n\n---\n\n## Testing\n\nTested on Windows 10 with:\n\n- Chrome\n- Firefox\n- Microsoft Edge\n\nEach snippet tested in both browser and device views.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisnajman%2Freact-router-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisnajman%2Freact-router-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisnajman%2Freact-router-tutorial/lists"}