MovieRama is a social sharing platform that allows users to share their favorite movies. Each movie entry includes a title, description, the submitting user's name, the date it was added, and counts of likes and dislikes. Users can interact with the platform by liking or hating movies, and can sort the list of movies based on these interactions or the date added.
- Backend: Java JDK 17, Apache Maven 3.6.3
- Frontend: Node v20.9.0, Angular CLI: 16.2.9
The application is dockerized for ease of setup and consistency across different environments. To run the application:
- Ensure Docker is installed on your system.
- Clone the repository to your local machine and navigate to the
movierama/docker
folder. - Run the following command to build and start the application:
docker-compose up --build
After the application services start:
- Open a web browser.
- Visit
http://localhost:4200
to access the MovieRama application. - From here, you can view movies, sign up for an account, or log in if you already have an account.
This document outlines the usage of the API endpoints for the authentication, movie management, user management, and voting system.
- Purpose: Authenticate a user and retrieve a JWT token.
- Request Body: Expects an
AuthenticationRequestDTO
withusername
andpassword
. - Success Response:
200 OK
withAuthenticationResponseDTO
containing the JWT token. - Error Response:
401 Unauthorized
if authentication fails.
- Purpose: Add a new movie.
- Request Body: Expects a
MovieDTO
with movie details. - Success Response:
201 Created
with the addedMovieDTO
. - Error Response:
400 Bad Request
if the request is invalid.
- Purpose: List movies with pagination and sorting options.
- Query Parameters:
page
: Page number (default is 0).size
: Number of items per page (default is 10).sort
: Sorting criteria (default isaddedDateDesc
).
- Success Response:
200 OK
with aPage<MovieDTO>
containing the list of movies. - Error Response:
400 Bad Request
if the parameters are invalid.
- Purpose: Retrieve user information by user ID.
- Path Variables:
id
: The ID of the user.
- Success Response:
200 OK
with theUser
details. - Error Response:
404 Not Found
if the user does not exist.
- Purpose: Register a new user.
- Request Body: Expects a
UserRegistrationDTO
with the user's registration details. - Success Response:
200 OK
with the createdUser
object. - Error Response:
400 Bad Request
if the request is invalid.
- Purpose: Submit a vote for a movie.
- Query Parameters:
movieId
: The ID of the movie being voted on.voteType
: The type of vote (e.g.,LIKE
orDISLIKE
).
- Success Response:
200 OK
with theVoteDTO
. - Error Response:
400 Bad Request
if the parameters are invalid or404 Not Found
if the movie doesn't exist.
- Purpose: Remove a vote for a movie.
- Query Parameters:
movieId
: The ID of the movie for which the vote should be removed.
- Success Response:
200 OK
with no content. - Error Response:
400 Bad Request
if the parameters are invalid or404 Not Found
if the vote or movie doesn't exist.
If you encounter any issues with running the application using Docker, ensure the following:
- Docker daemon is running on your system.
- Ports required by the application are not being used by another service.
- You have the necessary permissions to run Docker commands on your system.