Restful CRUD API for a simple user management application using Spring Boot, Mysql, JPA and React.
-
Java - 11
-
Maven - 4.0
1. Clone the application
git clone https://github.com/gaosth/PRP_backend.git
2. Create Mysql database
create database PRP
3. Change mysql username and password as per your installation
-
open
src/main/resources/application.yaml
-
change
spring.datasource.username
andspring.datasource.password
as per your mysql installation
4. Build and run the app using maven
mvn package
java -jar target/Spring-boot-User-demo.jar
Alternatively, you can run the app without packaging it using -
mvn spring-boot:run
The app will start running at http://localhost:8080.
The app defines following CRUD APIs.
GET /users
POST /users
GET /users/{userId}
PUT /users/{userId}
DELETE /users/{userId}
You can test them using postman or from the UI.
1. Access localhost:8080
The app has embedded front-end pages. Access localhost:8080
to enter the top page.
cd Frontend
2. Register and Login
Check the database for the user data, enter the email
and password
to log in. In register page, you could register through email
, and the user name will generated automatically from email
.