Skip to content

yasserjanah/StudentManagement-Spring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Students Management using Spring Framework

1. Create a new Spring Boot project

  • Use the following command to create a new Spring Boot project
    $ mvn archetype:generate -DgroupId=ma.janah -DartifactId=students-management -Dversion=1.0-SNAPSHOT -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
    
  • Using Graphical Interface:

2. Entities:

  • Student:
    • id: String (primary key)
    • firstName: String
    • lastName: String
    • email: String
    • dateOfBirth: DATE
    • gender: GenderType
    • enRegle: Boolean

Student Entity

  • GenderType: GenderType Enum

3. Repositories:

  • StudentRepository: Student Repository

4. Services:

  • IStudentService:

  • StudentServiceImpl:

5. Controllers:

  • StudentController:

6. Templates:

  • baseTemplate.html:

  • index.html:

  • delete student using HTTP DELETE:

  • other templates:

6. Spring Security:

  • Using UserDetails Strategy:

    6.1 Entities:

    • AppUser:
      • userId: String (primary key)
      • username: String
      • password: String
      • active: Boolean
      • roles: List of Role


    • AppRole:
      • roleId: Long (primary key)
      • roleName: String
      • description: String


    6.2 Repositories:

    • AppUserRepository:

    • AppRoleRepository:

    6.3 Services:

    • ISecurityService:

    • SecurityServiceImpl:

    6.4 UserDetailsService:

    • UserDetailsServiceImpl:

    6.5 SecurityConfig:

    • Enabling Method Security:

    • Secure Each Route: @PreAuthorize("hasAuthority('ADMIN')")

    • Security Configuration:

7. Spring Application:

  • application.properties:

  • create start function to add some data:

  • database:

8. Other Functionalities:

  • custom Exception Handler:

  • custom login page:


  • custom logout:

  • update security config

9. Screenshots:

Home


Search


Add new student


Edit student