Giter VIP home page Giter VIP logo

todo-app's Introduction

Context API

Author: Ryan Emmans

Summary of Problem Domain

To Do List Manager

Phase 1/2: Incorporate configuration settings to the application

Phase 3: Adding security and access controls to the application.

Phase 4: Integrating with a live API

Phase 1 Requirements

  • Style the application using the Blueprint Component API

  • Properly modularize the application into separate components

  • Implement the Context API to make some basic application settings available to components

    • How many To Do Items to show at once
    • Whether or not to show completed items

Phase 2 Requirements

  • Implement the Context API to make some basic application settings available to components
    • How many To Do Items to show at once
    • Whether or not to show completed items
  • Provide the users with a form where they can change the values for those settings
    • This should be given in the form of a new component, perhaps linked to from the main navigation
  • Save the users choices in Local Storage
  • Retrieve their preferences from Local Storage and apply them to the application on startup

Phase 3 Requirements

  • Provide a way for other users to create new accounts.
  • Provide a way for all users to login to their account.
  • Make sure that To Do items are only viewable to users that have logged in with a valid account.
  • Ensure that only fellow users that are allowed to “create”, based on their user type, can add new To Do Items.
  • Ensure that only fellow users that are allowed to “update”, based on their user type, can mark To Do Items complete.
  • Ensure that only fellow users that are allowed to “delete”, based on their user type, can delete new To Do Items.

Phase 4 Requirements

  1. Alter the Add, Toggle Complete, and Delete functions within your to-do application to use your API instead of in-memory state.
    • Fetch the current list of items from the database on application start
    • Whenever you add/update/delete an item, refresh the state so the user can instantly see the change
  2. Alter the Login Context to use the server to login users instead of our mock users list.
    • Be sure to store the token in state as well as in a cookie so you can reference it later.

Links to application deployment

Netlify Status
GitHub Actions
Pull Requests

Requirements / Notes

Create a settings Context that can define how our components should display elements to the User.

  • Implement the React context API for defining settings across the entire application.
    • Create a context for managing application display settings and provide this at the application level.
    • Display or Hide completed items (boolean).
    • Number of items to display per screen (number).
    • Default sort field (string).
    • Manually set (hard code) those state settings in the context provider’s state, they should not be changeable.
  • Consume and utilize context values throughout your components
    • Show a maximum of a certain number of items per screen in the <List /> component
      • Provide “next” and “previous” links to let the users navigate a long list of items
    • Hide or show completed items in the list
    • Optional: Sort the items based on any of the keys (i.e. difficulty)

Pagination Notes:

  • Only display the first n items in the list, where n is the number to display per screen in your context.

    • If you have more than n items in the list, add a button labeled Next that will replace the list with the next n items in the list.
    • If you are past the first n items (i.e. on page 2 or higher), add a button labeled Previous that will replace the list with the previous n items in the list.

API Server

  • You will need deployed API Server, which implements a todo item data model
    • GET /todo: Gets a list of all items
    • POST /todo: Adds an item
    • PUT /todo: Updates an item (you’ll use this to mark them as complete)
    • DELETE /todo/:id: Deletes an item

Authentication Server

  • You will need a deployed Authenticated API Server, which supports:
    • Registration (/signup)
    • Login (/signin)
    • Authorization (via Bearer Token)
    • ACL (using user roles)
      • Make sure you have created the user roles and permissions lists that your front-end is expecting to tap into
    • To Do data model for storing the actual to do items

todo-app's People

Contributors

ryanemmans avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.