A simple backend application built with Spring Boot which integrates Spring Web, Spring Data JPA and Mail Sender to provide the backend service for User Center. It supports CRUD operations such as:
- User registration/login.
- View/update user settings.
- Article publish/update/delete/show
RESTful Web Service is built based on SpringMVC. The ORM layer follows the JPA specification with default provider Hibernate. JWT is used for authorization purpose. Strategy Pattern / Responsibility Chain Pattern are adopted for service handling
- Spring Boot / Spring MVC
- Spring Data JPA
- JWT/Java Mail Sender
- Mysql
-
Registration/Login:
Post: user/getcaptcha
- payload:
{"username":"your_username","password":"your_password","email":"[email protected]"}
- payload:
Post: user/register
- payload:
{"username":"your_username","password":"your_password","email":"[email protected]", "captcha:"captcha"}
- payload:
Post: user/login
- paylaod:
{ username : "your_username", password : "your_password"}
- paylaod:
-
User Center (Requires Auth header):
Post: account/center
Post: account/settings/profile/show
Post: account/settings/profile/update
- payload:
{"username": "admin","email": "[email protected]","personalProfile": "Oh Yeah","country": "","province": "","city": "","streetAddress": "","areaNumber": "","phoneNumber": "123123"}
- payload:
Post: account/settings/notice/show
Post: account/settings/notice/notice
- payload:
{"todoNotice": "1","sysMessageNotice": "1","otherUserMessageNotice": "1"}
- payload:
-
Article (Requires Auth header):
Post: article/publish
- payload:
{"publishTime":"","title":"","content ":"","articleTagList ":[]}
- payload:
Post: article/update
- payload:
{"id":"","publishTime":"","title":"","content ":"","articleTagList ":[]}
- payload:
Post: article/delete
- payload:
{"id":""}
- payload:
Post: article/show/detail
- payload:
{"id":""}
- payload:
- Update settings in
application.properties
- Import
maven
dependency - Ensure
mysql
server is running. - Start application.
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Spring Web
- Java Mail Sender
- Spring Data JPA
The following guides illustrate how to use some features concretely: