Giter Site home page Giter Site logo

react-docker-todo-list's Introduction

react-docker-todo-list

The purpose of this project was to familarize myself with React properties and concepts such as Props, Funcitonal and Class Components, State, and JSX as well as learn about containerization with Docker, specifically containerization of React apps.

Tools Used:

The application allows the user to input text and submit that text into an array that is displayed on screen:

  • react for rendering jsx elements
  • material ui for desinging css components
  • .yml for storing configuration data for docker
  • docker for containerizing the project
  • npm as a package manager

Here is the container being upped with Docker-compose up --build: Screenshot 2023-07-02 at 3 10 39 PM And here is the container shown in docker desktop: Screenshot 2023-07-02 at 3 08 40 PM

The application allows the user to input text and submit that text into an array that is displayed on screen, or they can click the close button to delete the entry.

Screenshot 2023-07-02 at 2 47 17 PM Screenshot 2023-07-02 at 2 47 32 PM Screenshot 2023-07-02 at 2 47 44 PM Screenshot 2023-07-02 at 2 47 51 PM

The Todo component has two functions that handle different events for the acutal displayed list of tasks. Checking a task as complete and deleting a task.

Screenshot 2023-02-23 at 2 36 46 PM

The TodoForm component handles the addition of tasks into the array of tasks.

Screenshot 2023-02-23 at 2 43 37 PM

The TodoList Component adds attributes for each entry in the task array. It stores the value, id, completed state, and removed state.

Screenshot 2023-02-23 at 2 45 02 PM

In App.js, we import all of the components needed to update our display. The useEffect() function allows us to store information in local storage so that when the page is refreshed, the tasks array does not reset to empty.

Screenshot 2023-02-23 at 2 49 11 PM

App.js implements the functionality of the functions called by the components. addtodo() adds a task to the array. toggleComplete() changes the state to either true or false depending on what it was previously. removeTodo() removes a task from the array by searching for a matching id. The final return passes the JSX elements to update the page. Because React is being used, a Virtual DOM is created, and when changes are made, it is compared against the actual DOM and only the changed elements are updated.

Screenshot 2023-02-23 at 2 52 02 PM

CSS was taken from @material-ui.

react-docker-todo-list's People

Contributors

mfkimbell 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.