Skip to content

Latest commit

 

History

History
48 lines (41 loc) · 1.37 KB

README.md

File metadata and controls

48 lines (41 loc) · 1.37 KB

Recipes App with React.js

made by Angelina Yakimova

Implemented CRUD operations for Users, Recipes and Likes

Start Application - start script

npm i
npm start

Can't work without the server though.

npm run server

Routes

/   | Home Component

/recipes   | Recipes Component

/recipes/id/details   | Details Component

  /recipes/create   | Create Component

  /recipes/id/edit   | Edit Component

  Delete Functionality

  Like Functionality

 Create Edit Delete and Like are operetions that can be performed only by users or creators of the resource.

/users/id   | UserProfile Component

 Shows user's own recipes.

  • Implement showing liked recipes
  • Change user credentials

Code Specifications

AuthContext

Global context that stores state of user information. To have acces to user data stored you can use the hook.

const { user, login, register, logout, isAuthenticated } = useAuthContext();

LocalStorage hook

Stores the state to Local Storage.

const [state, setstate] = useLocalStorage(key, initialState);

Services

Requester

Handles fetch requests to API. Automatically attaches token if available.