Backend Development 5 min read

SpringBoot Backend Project with JWT Authentication, Shiro Authorization, MyBatis-Plus, and Custom Annotations

This article introduces a SpringBoot-based backend project that integrates JWT for stateless authentication, Apache Shiro for flexible authorization, MyBatis-Plus for enhanced ORM, custom annotations for logging and validation, and demonstrates setup, deployment, and usage instructions.

Top Architect
Top Architect
Top Architect
SpringBoot Backend Project with JWT Authentication, Shiro Authorization, MyBatis-Plus, and Custom Annotations

Background: Front‑end and back‑end separation is now standard; SpringBoot simplifies coding, configuration, and deployment, making it a popular choice for micro‑service frameworks.

Technologies used: MyBatis‑Plus provides code generation and convenient CRUD operations while retaining MyBatis flexibility; Apache Shiro offers a simple yet powerful Java security framework, often preferred over Spring Security.

Project features: custom @Log annotation logs operations to the database; custom @Pass annotation bypasses authentication; unified request body handling with JSONObject and a @ValidationParam annotation for null checks; bcrypt password hashing; Shiro annotations for fine‑grained permission control and a @CurrentUser annotation to obtain the logged‑in user; Spring AOP for declarative transactions and XSS filtering; JWT‑based stateless login returning token and permission data.

Program flow: users POST credentials to /login to receive a JWT token; subsequent requests include the token in the Authorization header; the server validates the token, returns 401 on failure, and uses Shiro for authorization.

Running the project: clone the repository, ensure JDK 1.8, use Maven to import the liugh‑parent pom, create a MySQL database named liugh with UTF‑8 encoding, execute liugh.sql , configure application‑dev.properties , run SpringbootApplication.java , then access localhost:8081/login with credentials 123456/123 to obtain a token for other APIs.

The repository is available at https://github.com/qq53182347/liugh-parent, and the project includes complete comments and a custom startup banner.

BackendJavaSpringBootMyBatis-PlusJWTshiro
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.