This project is a backend application developed in Java using Servlet, Apache Tomcat and MySQL. The purpose of the project is to provide an API for managing movies, including CRUD operations with Postman.
backend/
├── .idea/
├── cmarttomcat/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── org/
│ │ │ │ ├── application.services/
│ │ │ │ │ ├── adapters
│ │ │ │ │ │ └── IRepository
│ │ │ │ │ └── services
│ │ │ │ │ └── IRepository
│ │ │ │ ├── domain.models/
│ │ │ │ │ └── PeliculaService.java
│ │ │ │ │
│ │ │ │ ├── infrastructure.repository/
│ │ │ │ │ ├── controllers/
│ │ │ │ │ │ └── PeliculaController.java
│ │ │ │ │ └── database
│ │ │ │ │ ├── DatabaseConnection.java
│ │ │ │ │ └── MySqlRepositoryImpl.java
│ │ │ │ │
│ │ └── resources/
│ │ └── movies_db.sql
│ │
│ └── webapp/
│ └── WEB-INF/
│ └── index.jsp
├── .gitignore
├── backend.iml
├── pom.xml
└── README.md
- JDK 17
- Apache Tomcat 9.0
- MySQL
- Maven
- Create a database in MySQL (Copy the one from the resource folder)
- Clone repository (It is recommended to do a FORK)
- Configure Apache Tomcat to deploy the application.
Tip
Change port in Apache Tomcat
Connector port=”8090″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″
- GET /movies/{id}: Gets a movie by ID.
- POST /movies Create a new movie.
- PUT /movies/{id}: Update an existing movie.
- DELETE /movies/{id}: Delete a movie by ID.
Tip
For PUTs on postman:
- Select: Body
- Select: Rows
- Paste a JSON on rows:
- { "id":1, "title":"The Lord of the Rings", "director": "Peter Jackson", "genre": "Fantasy" }