This repo contains a semi-finished state of the project you will be working on in this workshop. You will be creating a new Next.js project and then leveraging GitHub Copilot to build out the code changes.
- Create a new Next.js project
yarn create next-app
- Accept all the defaults (App Router, Tailwind CSS, Typescript etc)
- Navigate here to retrieve the backend API URL:
https://dummyjson.com/docs/todos
. You'll reference this page to see the JSON object structure also. - Create a new typescript model for a
Todo
object. Use GitHub Copilot to generate this class using the sample JSON as a reference. - Create a new typescript service for a
TodoService
object. Use GitHub Copilot to generate this class using axios for interacting with the JSON API provided. Import the Todo class/interface created earlier in this file. - Have GitHub Copilot modify
page.tsx
to remove the default template contents. - Generate a table based on the Todos retrieved from TodoService on page load. Make sure the table is rendered based on that data.
- Add a delete button to the table and implement a handler to call the correct method on the
TodoService
. - Restyle the page using GitHub Copilot. Hint: Also look to restyle the tailwind defaults.
- Create a form and handler for creating new Todos.
- Refactor the Todos table into its own component.
- Implement specific react hooks for the Todos.
- Implement caching.
- Implement loading indicator on data refreshes.
- Generate documentation.