Skip to content

radouanefadel/movie-library-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Library

This is a small project to manage movies.

Quick start

REST API

Install dependencies
mvn install

Or

mvn package
Run REST API as a maven project
mvn spring-boot:run

Front-end (Angular)

Run application by using Angular-cli and go to http://localhost:4200

ng serve

Click here to read more.

Spring Boot application

Dependencies

  • Lombok;
  • Jackson-databind;
  • HATEOAS (not used yet).

REST controllers

  • Movie Controller
    • Get all movies HashSet<MovieDTO> findAll();
    • Find movie by UUID MovieDTO findOne(String uuid);
    • Add movie MovieDTO save(MovieFlatDto movieDto);
    • Update movie MovieDTO update(MovieFlatDto movieDto);
    • Delete movie void delete(String uuid).
  • Director Controller
    • Get all directors HashSet<DirectorDto> findAll();
    • Find director by UUID DirectorDto findOne(String uuid);
    • Find movies for by full name of director DirectorDto findMovies(String fullName).
  • Type Controller
    • Get all types HashSet<TypeDto> findAll();
    • Find type by UUID TypeDto findOne(String uuid);
    • Find movies for by label of type TypeDto findMovies(String label).

Models

models

Class MovieFlatDto is used to be coherent with stored data in JSON file.

Services

services

Repositories

repositories

Interacting with JSON file

The JSON file is located at ~/ext/data/movies.json

Configuration at application.properties

datasource.json.location=/data/movies.json
datasource.json.fullPath=ext/data/movies.json

Class MoviesIO

This is the main class used to interact with JSON file and implementing the following methods:

  • Read the JSON file HashSet<MovieFlatDto> read();
  • Append void write(HashSet<MovieFlatDto> movies).

Thank you!