Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.
/ warehouse Public archive
generated from mateus-f-torres/barefoot

Organize your products with React and IndexedDB

License

Notifications You must be signed in to change notification settings

mateus-f-torres/warehouse

Repository files navigation

Netlify Status Build Status Commitizen friendly License MIT

Warehouse

A practice project focused on React and Web Storage.
Main practice points:

If you would like to read more about what I learned with this project please see the Learning document.

PS: since I'm from Brazil the expected currency format is the Brazilian real

Features

Auto-Login

Use LocalStorage to read/write current user
Share that information with React useContext hook
Redirect logged users to main app, else show login page

Local Database

Whenever a user adds/edits/deletes a product, save that change in the IndexedDB
Fake an external API interaction by placing these actions inside a delay/error trap
Use the same database for the same company, even if the username is different

Super-Custom-Hook-Reducer

Instead of using a state management library, do it yourself to feel the pain
Combine useState, useEffect and useReducer to create a dedicated Custom Hook
Realize the different types of state that are needed on an application

Controlled-Components... why ?

While learning to use the Constraint Validation interface I came upon this question
Using the SubmitEvent we can access the input values by the name property
There is no need to control the input value since the validation will occur before submission

License

MIT License
Made by Mateus F Torres
Initial structure from barefoot template

About

Organize your products with React and IndexedDB

Resources

License

Stars

Watchers

Forks