Code Monkey home page Code Monkey logo

springbootdemoproject's Introduction

Springboot Application Example

School Management System

Technologies

  • Springboot
  • Maven
  • Java corretto 11
  • Spring JPA
  • MariaDB
  • Spring Security
  • Thymeleaf

Business Requirement:

Your task is to create a basic School Management System where students can register for courses, and view the course assigned to them.

Work-Flow:

Website with links to each service

  • homepage
  • create/modify student
  • create/modify course
  • view students
  • find student by email
  • view courses

starter dependencies:

  • Spring web
  • Spring Boot DevTools
  • Lombok
  • Thymeleaf
  • Mariadb Driver
  • Spring Data JPA
  • Validation

Requirement 1 - Models:

Models requires:

  • no args constructor
  • all args constructor
  • required args constructor
  • setters and getter
  • toString (exclude collections to avoid infinite loops)
  • override equals and hashcode methods (don't use lombok here)
  • helper methods
Student (@Table(name = "student")):
Field Datatype Description Database attributes @Column()
email String Student’s unique identifier Primary key, 50 character limit, name email
name String Student’s name 50 character limit, not null, name name
password String Student’s password 50 character limit not null, name password
courses List<Course> Student courses list Join table strategy name student_courses , name of student primary key column student_email and inverse primary key (courses) column courses_id , fetch type eager, cascade all except remove
Course (@Table(name = "course")):
Field Datatype Description Database attributes @Column()
id int Course unique identifier Primary key
name String Course name 50 character limit, not null
instructor String Instructor name 50 character limit not null
students List<Student> Course learners list fetch type eager, cascade all except remove, mappedBy courses

Requirement 2 - Data Access Object (dao) interfaces:

StudentRepository:
CourseRepository:
Abstract method Return type Parameters Description
findStudentCourses List<Course> String email return student courses

Requirement 3 - Service layer:

implement interfaces:

  • StudentService: implement StudentRepository required methods.
  • CourseService: implement CourseRepository required methods.

Requirement 4 - Controllers

HomeController
  • general endpoints
StudentController
  • mapping for services
CourseController
  • mapping for services

Requirement 5 - View using Thymeleaf

  • build a template using thymeleaf fragments

Requirement 6 - Spring Security

  • implement spring security
  • hide/show services using thymeleaf

Requirement 7 - Testing

  • use mock database H2 to test data
  • AssertJ tests

springbootdemoproject's People

Contributors

jhabboubi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.