{"id":42638288,"url":"https://github.com/janluke/my-reads","last_synced_at":"2026-01-29T06:04:23.408Z","repository":{"id":126674649,"uuid":"275635788","full_name":"janluke/my-reads","owner":"janluke","description":"React app for tracking books you are reading, want to read or have read (1st project of Udacity React Nanodegree). ","archived":false,"fork":false,"pushed_at":"2025-06-26T17:32:54.000Z","size":5927,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-26T18:34:35.091Z","etag":null,"topics":["books","coursework","javascript","react","react-router","udacity","udacity-react-nanodegree"],"latest_commit_sha":null,"homepage":"https://janluke-myreads.netlify.app/","language":"JavaScript","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/janluke.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,"zenodo":null}},"created_at":"2020-06-28T17:34:12.000Z","updated_at":"2025-06-26T17:29:34.000Z","dependencies_parsed_at":"2023-06-17T15:30:29.552Z","dependency_job_id":null,"html_url":"https://github.com/janluke/my-reads","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/janluke/my-reads","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fmy-reads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fmy-reads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fmy-reads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fmy-reads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janluke","download_url":"https://codeload.github.com/janluke/my-reads/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluke%2Fmy-reads/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28865258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T05:56:06.453Z","status":"ssl_error","status_checked_at":"2026-01-29T05:55:57.668Z","response_time":59,"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":["books","coursework","javascript","react","react-router","udacity","udacity-react-nanodegree"],"created_at":"2026-01-29T06:03:09.203Z","updated_at":"2026-01-29T06:04:23.402Z","avatar_url":"https://github.com/janluke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MyReads   \u003c!-- omit in toc --\u003e\n\n- [Description](#description)\n  - [What differentiates my implementation](#what-differentiates-my-implementation)\n  - [Tools and libraries](#tools-and-libraries)\n- [Available Scripts](#available-scripts)\n  - [`npm start`](#npm-start)\n  - [`npm test`](#npm-test)\n  - [`npm run build`](#npm-run-build)\n  - [`npm run eject`](#npm-run-eject)\n- [The backend server](#the-backend-server)\n  - [`getAll()`](#getall)\n  - [`update(book, shelf)`](#updatebook-shelf)\n  - [`search(query)`](#searchquery)\n  - [The book object](#the-book-object)\n  - [The code I used to describe the book object](#the-code-i-used-to-describe-the-book-object)\n\n## Description\n\n**Demo:** https://janluke-myreads.netlify.app/\n\nA simple React app for tracking the books you are currently reading,\nwant to read or have already read.\n\nThis is my implementation of the final assessment project for the Udacity's \n\"React Fundamentals\" course, part of the React Nanodegree Program.\nThe purpose of the project is familiarizing with React and React Router.\n\n### What differentiates my implementation\n\n- **Restyling.** The app was built from scratch and was restyled wrt the one provided\n  by Udacity. However, I kept the structure of the app the same, even if not optimal\n  for the UX. That's mostly because I decided to not use an external component library\n  to force myself practicing CSS. On the other hand, implementing what I had in mind\n  was a little too time-consuming for being worthwhile.\n\n- **Theming.** I implemented light/dark theming using scoped CSS variables.\n   A theme is just a CSS class containing variables (e.g. `--color-primary`).\n   I wrapped the entire application with a `div` node whose class attribute is set\n   to current theme class. Changing theme is as easy as changing the `div` class.\n\n- **Optimistic updates.** When the user changes the shelf of a book, the UI gets immediately\n  updated. If the operation doesn't succeed server-side, the optimistic update is reverted\n  and the app shows a toast with an error message.\n\n- **Debounced search.** The search input field is debounced and, in general, the implemented logic\n  prevents unnecessary API requests.\n\n### Tools and libraries\n\n- **Bootstrapping**: [Create React App](https://github.com/facebook/create-react-app).\n- **Routing**: React Router.\n- **Styling**: Sass, but I didn't use much its features.\n- **State management**: none, because it was out of scope. Redux is the central topic\n  of the 2nd course. I used the Context API though.\n- **Library of components**: none, because I wanted to practice CSS. Nonetheless, I used\n  external packages for some specific components:\n  * `react-loading` for the loading indicator;\n  * `iblis-react-undraw` for using the awesome [Undraw illustrations](https://undraw.co/)\n    changing the primary/accent color;\n  * `react-toastify` for toasts.\n- **Animations**: I used `react-flip-toolkit` for animating the grids and occasionally\n  CSS transitions/keyframes.\n\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\u003cbr /\u003e\n\nThe page will reload if you make edits.\u003cbr /\u003e\nYou will also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\u003cbr /\u003e\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) \nfor more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\u003cbr /\u003e\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\u003cbr /\u003e\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) \nfor more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. \nThis command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) \nright into your project so you have full control over them. All of the commands except `eject` will still work, \nbut they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, \nand you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful\nif you couldn’t customize it when you are ready for it.\n\n\n## The backend server\n\nThe app uses a \"dummy\" REST API provided by Udacity. The API is not very well documented by Udacity \n(maybe intentionally?). This section is a copy of the provided API documentation with additional notes\nI took when I started working on the project. Maybe it can be of help to other students.\n\n### `getAll()`\n\nReturns a Promise which resolves to a JSON object containing the books of the user\ngrouped by shelf:\n\n```javascript\n{\n  \"read\": [/* books */],\n  \"wantToRead\": [/* books */],\n  \"currentlyReading\": [/* books */]\n}\n```\n\n### `update(book, shelf)`\n\nParameters:\n\n- book: `\u003cObject\u003e` containing at minimum an `id` attribute\n- shelf: `\u003cString\u003e` contains one of `[\"wantToRead\", \"currentlyReading\", \"read\", \"none\"]`\n\nReturns a Promise which resolves to an object that describes the current content \nof all shelves in terms of book IDs:\n\n```javascript\n{\n  \"read\": [/* book ids */],\n  \"wantToRead\": [/* book ids */],\n  \"currentlyReading\": [/* book ids */]\n}\n```\n\n### `search(query)`\n\nReturns a Promise which resolves to a JSON object containing a list of a maximum of 20 book objects.\n\n**IMPORTANT**: the returned books do not know which shelf they are on. They are raw results only. \nYou'll need to make sure that books have the correct state while on the search page.\n\n### The book object\n\n```yaml  \u003c!--YAML has better syntax highlighting than JSON on GitHub --\u003e\n{\n    \"title\": \"string\",\n    \"subtitle\": \"string\",\n    \"authors\": [\n        \"string\"\n    ],\n    \"publisher\": \"string\",\n    \"publishedDate\": \"string\",\n    \"description\": \"string\",\n    \"industryIdentifiers\": [\n        {\n            \"type\": \"string\",\n            \"identifier\": \"string\"\n        }\n    ],\n    \"readingModes\": {\n        \"text\": \"boolean\",\n        \"image\": \"boolean\"\n    },\n    \"pageCount\": \"number\",\n    \"printType\": \"string\",\n    \"categories\": [\n        \"string\"\n    ],\n    \"averageRating\": \"number\",\n    \"ratingsCount\": \"number\",\n    \"maturityRating\": \"string\",\n    \"allowAnonLogging\": \"boolean\",\n    \"contentVersion\": \"string\",\n    \"panelizationSummary\": {\n        \"containsEpubBubbles\": \"boolean\",\n        \"containsImageBubbles\": \"boolean\"\n    },\n    \"imageLinks\": {\n        \"smallThumbnail\": \"string\",\n        \"thumbnail\": \"string\"\n    },\n    \"language\": \"string\",\n    \"previewLink\": \"string\",\n    \"infoLink\": \"string\",\n    \"canonicalVolumeLink\": \"string\",\n    \"id\": \"string\",\n    \"shelf\": \"string\"\n}\n```\n\n### The code I used to describe the book object\n\n```js\nfunction getSchemaOf(obj) {\n  if (typeof obj !== \"object\") {\n    return typeof obj;\n  }\n  else if (obj instanceof Array) {\n    return (obj.length \u003e 0) ? [getSchemaOf(obj[0])] : [];\n  }\n  else {\n    let specs = {};\n    for (let prop of Object.getOwnPropertyNames(obj)) {\n      specs[prop] = getSchemaOf(obj[prop]);\n    }\n    return specs;\n  }\n}\n\nBooksAPI.getAll().then(\n  (data) =\u003e console.log(\n    JSON.stringify(getSchemaOf(data[0]), null, 4)\n  )\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanluke%2Fmy-reads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanluke%2Fmy-reads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanluke%2Fmy-reads/lists"}