It is a full stack Login application build by using SpringBoot (SpringSecurity + JWT Authentication) and ReactJs (ReactHooks + JWT Authentication + React Router + Axios).
Login-Application Steps to Setup the Spring Boot Back end app (FullStack-Login)
-
Clone the application git clone https://github.com/snehal-bagde/SpringSecurity-ReactJs-Login-App.git cd FullStack-Login
-
Create MySQL database
create database login_app Change MySQL username and password as per your MySQL installation open src/main/resources/application.properties file. change spring.datasource.username and spring.datasource.password properties as per your mysql installation
-
Run the app Run the spring boot app using IDE The server will start on port 8080.
-
Default Roles The spring boot app uses role based authorization powered by spring security. To add the default roles in the database use below queries, INSERT INTO roles (id, name) VALUES (1, 'ROLE_USER'); INSERT INTO roles (id, name) VALUES (2, 'ROLE_MODERATOR'); INSERT INTO roles (id, name) VALUES (3, 'ROLE_ADMIN'); Any new user who signs up to the app is assigned the ROLE_USER by default.
Steps to Setup the React Front end app (polling-app-client)
First go to the react-hooks-jwt-auth folder -
cd react-hooks-jwt-auth
Then type the following command to install the dependencies and start the application
npm install && npm start
The front-end server will start on port 3000.