LOGIN WITH STRAPI FOR HYP SITE
Per la versione Italiana clicca QUI
HYP is the prototype of a web app that aims to improve communication between students and the school..
In this documentation I will illustrate the realization of the login component.
Create a folder and follow the steps:
- Install REACT:
for more details https://reactjs.org/
npx create-react-app [nome dell'app] cd my-app npm start
Use the style of this component, you must also install the library inside the ** React ** folder Node-SASS
npm install node-sass
npm install strapi@beta -g
then create the new database
strapi new cms --quickstart
for more details https://strapi.io/
For call to API STRAPI recommends installing the following plugin to install in the REACT
npm i axios
If both steps are successful you are ready to download and configure the component that will take care of Login.
CONFIGURE THE LOGIN COMPONENT
Once you have downloaded this Git, insert the Login.jsx and Login.scss files into the React folder inside src and then overwrite the index.js file.
To make sure that everything works we still need to make two changes
Enter the ** Strapi ** backend and enter Roles and Permission> Authenticated> scroll the page, open the Users Permission curtain and enter the following fields in the Auth field.
> > and checked the field
As a second step you need to replace the url with that of your database created in strapi (with ctrl + F look for the following word '[InsertUrlStrapi]').
Once all these steps are done, everything will be ready. (Inside the file you will find comments explaining the functions)