Skip to content

gitnes94/MovieApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MovieApp – Spring Boot CRUD Application

A web application for managing a movie collection, built with Spring Boot, Spring MVC, Spring Data JPA, and Thymeleaf.

Features

  • List all movies with search and filter functionality
  • Create new movies via form
  • Edit existing movies
  • Delete movies
  • Filter by title, director, genre, and minimum rating
  • Pagination with configurable page size
  • Validation with error messages in forms
  • Custom error handling with meaningful error pages

Tech Stack

  • Java 25
  • Spring Boot 4.0.3
  • Spring MVC
  • Spring Data JPA
  • Thymeleaf
  • H2 (in-memory database)
  • Bean Validation (Jakarta Validation)
  • JUnit 5 + Mockito

Project Structure

src/main/java/com/example/movieapp/
├── config/
├── controller/
│   ├── HomeController.java
│   └── MovieController.java
├── dto/
│   ├── CreateMovieDTO.java
│   ├── MovieDTO.java
│   ├── MovieFilterDTO.java
│   └── UpdateMovieDTO.java
├── entity/
│   └── Movie.java
├── exception/
│   ├── DuplicateTitleException.java
│   ├── GlobalExceptionHandler.java
│   └── ResourceNotFoundException.java
├── mapper/
│   └── MovieMapper.java
├── repository/
│   └── MovieRepository.java
└── service/
    └── MovieService.java

src/main/resources/
├── static/
├── templates/
│   ├── error/
│   │   └── error.html
│   └── movies/
│       ├── create.html
│       ├── detail.html
│       ├── edit.html
│       └── list.html
└── application.properties

Getting Started

Prerequisites

  • Java 25
  • Maven

Run the application

mvn spring-boot:run

Open your browser and navigate to http://localhost:8080.

Run the tests

mvn test

Architecture

The application follows a layered architecture:

  • Controller – Handles HTTP requests and returns Thymeleaf views
  • Service – Contains business logic and coordinates between controller and repository
  • Repository – Data access layer using Spring Data JPA
  • Mapper – Converts between entities and DTOs
  • Entity – JPA-mapped domain object persisted to the database
  • DTO – Separate data transfer objects for create, update, and view operations

Movie Fields

Field Type Description
id Long Auto-generated primary key
title String Movie title (max 200 characters)
description String Movie description (max 2000 characters)
releaseDate LocalDate Release date
director String Director name
runtimeMinutes Integer Runtime in minutes (1-1200)
genre String Movie genre
rating Double Rating from 0.0 to 10.0

API Endpoints

Method URL Description
GET /movies List all movies with optional filters
GET /movies/{id} View movie detail
GET /movies/new Show create form
POST /movies/new Save new movie
GET /movies/{id}/edit Show edit form
POST /movies/{id}/edit Update movie
POST /movies/{id}/delete Delete movie

About

Movie CRUD application built with Spring Boot 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors