Skip to content

Spring Boot 수강신청 웹 사이트 토이 프로젝트

Notifications You must be signed in to change notification settings

wadekang/course-registration-system

Repository files navigation

course-registration-system

Spring Boot 수강신청 웹 사이트 토이 프로젝트

Main Page


Tools

  1. Java: JDK 11.0.13
  2. Spring Boot 2.6.4
  3. Gradle
  4. DB: H2 1.4.200 & MariaDB(AWS RDS) 10.5.13
  5. Cloud: AWS EC2
  6. CI/CD: TravisCI, AWS S3, AWS CodeDeploy

ERD


Login & Logout

Spring Security 적용

@RequiredArgsConstructor
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    private final UserDetailsServiceImpl userDetailsService;
    private final AuthSuccessHandler authSuccessHandler;
    private final AuthFailureHandler authFailureHandler;

    @Bean
    public BCryptPasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.csrf().disable()
                .authorizeRequests()
                    .antMatchers("/", "/home", "/login/**", "/css/**", "/signup/**").permitAll()
                    .anyRequest()
                    .authenticated()
                .and()
                    .formLogin()
                    .usernameParameter("loginId")
                    .passwordParameter("password")
                    .loginPage("/login")
                    .loginProcessingUrl("/login/action")
                    .successHandler(authSuccessHandler)
                    .failureHandler(authFailureHandler)
                .and()
                    .logout()
                    .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
                    .logoutSuccessUrl("/home")
                    .invalidateHttpSession(true)
                    .deleteCookies("JSESSIONID").permitAll()
                .and()
                    .sessionManagement()
                    .maximumSessions(1)
                    .maxSessionsPreventsLogin(false)
                    .expiredUrl("/login?error=true&exception=Session Expired!");
    }
}

수강 조회

전공별 수강조회 기능

과목별 분반 조회


수강 신청

첫 번째 셀렉트 박스에서 전공을 선택하면 두 번재 셀렉트 박스에 해당 전공 과목들이 나옴


수강 내역

내 수강 신청 내역


How to Build

1. git clone

git clone https://github.com/wadekang/course-registration-system.git

2. Make application-db.yml (db setting)

# file_path: /src/main/resources/application-db.yml

spring:
  datasource:
    url: [DB URL]
    username: [DB ID]
    password: [DB Password]
    driver-class-name: [DB Driver]

  jpa:
    hibernate:
      ddl-auto: [ddl-auto] # create, update, none, create-drop
    properties:
      hibernate:
        format_sql: true
        dialect: org.hibernate.dialect.MySQL5InnoDBDialect
        storage-engine: innodb

3. Test

4. Run Application

About

Spring Boot 수강신청 웹 사이트 토이 프로젝트

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published