This Project allows you to practice the concepts and techniques learned last Sunday and apply them in a concrete project. This assignment explored React authentication and private routes. In your Project for this assignment, you will demonstrate proficiency by creating a Single Page Application that performs CRUD (Create, Read, Update, Delete) operations on a remote server.
Read these instructions carefully. Understand exactly what is expected before starting this assignment.
Follow these steps to set up and work on your project:
- Create a forked copy of this project.
- Clone your OWN version of Repo (Not Gabi's by mistake!).
- Create a new Branch on the clone: git checkout -b
<firstName-lastName>. - Implement the project on this Branch, committing changes regularly.
- Push commits: git push origin
<firstName-lastName>. - RUN
npm installat the root to retrieve all the dependencies. - RUN
npm run devat the root of your project.
Follow these steps for completing your project:
Modify this application to use the endpoint provided below.
- Create new slices for
AuthandUser - Store user
tokenin cookies usingjs-cookiepackage. - Create new files for
Register,LoginandProfile - Make sure to create navigation for
Home,Register,LoginandProfile - Create
PrivateRoutecomponent that checks if user is logged in or not. WrapPrivateRouteon top of routes such asProfile. - Make sure to not allow user to edit or delete a note they didn't create.
Overview
In this assignment, you won't be using local server, you will be the using this endpoint:
https://notes-60by.onrender.comHere are all the endpoints you need to complete this project:
- A GET request to the
/notesendpoint will return an array of objects or an empty array. You won't need atokento get the data from this endpoint.
- A POST request to the
/create_noteendpoint expects to recieve an object as follows:
{
title: 'Clean the house',
content: "Buy cleaning products to clean"
}- A PUT request to the
/update_note/:idendpoint expects to recieve an object as follows:
{
title: 'Clean the house',
content: "Buy cleaning products to clean"
}- A DELETE request to the
/delete_note/:idendpoint with theidof the note you want to delete
| ---------------------------------------------------- |
- A POST request to the
/registerendpoint expects to recieve an object as follows:
{
"name": "Mohamed Ali"
"email": "email@address.com",
"password": "password"
}- A POST request to the
loginendpoint expects to recieve an object as follows:
{
"email": "email",
"password": "password",
}- A GET request to the
/userendpoint for get information for current user.
- Display current user's notes in their profile
- ADVANCED Modify server code and add roles such as "admin" to display all users in one page.