Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student Management System

A full-stack web application for managing student records, built with Spring Boot, Spring Security, Thymeleaf, and MySQL. Supports role-based access control (Student, Teacher, Admin), fuzzy search, and automated database backup.

Features

  • User Authentication & Authorization
    • Login / Register with Spring Security
    • BCrypt password encoding
    • Role-based access:
      • ROLE_STUDENT: view only
      • ROLE_TEACHER: create, edit, delete students
      • ROLE_ADMIN: full control
  • Student CRUD
    • Add, edit, delete, list students
    • Fuzzy search by name or surname
  • Responsive Web UI
    • Thymeleaf templates with dynamic role-based button rendering
  • Unit Testing
    • Controller tests with @WebMvcTest, MockMvc, @WithMockUser
    • Service layer tests with Mockito
  • Database Backup Script
    • Bash script backup.sh to dump MySQL database, compress, and clean old backups
    • Supports ~/.my.cnf for passwordless execution

Tech Stack

  • Java 17
  • Spring Boot 3.2.3
  • Spring Security 6
  • Spring Data JPA (Hibernate)
  • Thymeleaf + Bootstrap (custom CSS)
  • MySQL 8
  • Maven
  • JUnit 5 + Mockito
  • Git / GitHub

Quick Start

Prerequisites

  • Java 17
  • MySQL 8 running locally
  • Maven (or use the included Maven wrapper)

Setup

  1. Clone the repository
    git clone https://github.com/kitty1314/Springboot_Student_System.git
    cd Springboot_Student_System
  2. Create a MySQL database (e.g. student_db) Configure database connection
  3. Copy src/main/resources/application-template.properties to application.properties and fill in your own username/password.
  4. Build and run
./mvnw spring-boot:run

Default Accounts

Username Password Role
admin 123456 ROLE_ADMIN
studentA 123456 ROLE_STUDENT
teacher 123456 ROLE_TEACHER

You can register new users via /register.

Backup Script

A Bash script backup.sh is provided to dump the student_db database.

Usage: ./backup.sh Configuration: To avoid storing passwords in the script, create a ~/.my.cnf file:

[client]
user=root
password=your_mysql_password

Then set permissions: chmod 600 ~/.my.cnf The script creates timestamped .sql files in ./backups/, compresses them, and deletes backups older than 7 days.

Testing

Run unit tests:

./mvnw test

Project Structure

src/
├── main/
│   ├── java/.../studentsystemapp/
│   │   ├── config/         # SecurityConfig
│   │   ├── controller/     # MVC controllers
│   │   ├── entity/         # JPA entities (User, Student)
│   │   ├── repository/     # JPA repositories
│   │   └── service/        # CustomUserDetailsService
│   └── resources/
│       ├── templates/      # Thymeleaf HTML files
│       └── application.properties
└── test/                   # Unit tests

License

This project is for educational purposes.

About

使用springboot制作的学生管理系统,包含添加,搜索,查找功能

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages