SpringBoot Backend Project with Shiro, JWT, and Mybatis-Plus – Features, Architecture, and Deployment Guide
This article introduces a SpringBoot-based backend project that integrates Mybatis-Plus, Apache Shiro, and JWT for secure API development, outlines custom annotations, transaction handling, and provides step‑by‑step instructions for building, configuring, and running the application.
Front‑back separation has become a standard for internet projects, and SpringBoot simplifies coding, configuration, and deployment, making it a popular entry‑level micro‑framework for many companies. Mybatis-Plus enhances Mybatis with code generation and convenient CRUD operations, while Apache Shiro offers a powerful yet easy‑to‑use Java security framework, often preferred over Spring Security.
The project features include custom @Log annotation for automatic database logging, @Pass annotation to bypass authentication, unified request body handling with JSONObject , custom @ValidationParam for parameter validation, bcrypt password encryption, Shiro‑based permission annotations for fine‑grained button‑level control, a @CurrentUser annotation to retrieve the logged‑in user, centralized exception handling, Spring AOP for declarative transactions and XSS protection, and stateless JWT login returning token and permission data.
Program flow: users POST credentials to the /login endpoint 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 requires JDK 1.8, Maven, a MySQL database named liugh (UTF‑8 charset) initialized with liugh.sql , and a Redis service. After cloning the repository, import the liugh‑parent pom, adjust application‑dev.properties with MySQL credentials, and start the application via IDE or mvn clean package followed by java -jar liugh‑web.jar . The API base path is prefixed with /api/v1 , and the login endpoint is localhost:8081/api/login (default account: 13888888888/123456).
Additional notes: install Lombok plugin in the IDE to avoid compilation errors, and the project includes complete comments and a custom startup banner.
Java Captain
Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.