A quote generator API built with Spring Boot that provides random quotes from a PostgreSQL database.
This is a REST API developed with Spring Boot that allows users to retrieve random quotes. The application uses PostgreSQL as the database to store quotes, each containing:
- Title: The title of the quote source (e.g., movie, book).
- Phrase: The actual quote text.
- Character: The character who said the quote.
- Poster: A reference to the poster or image related to the quote.
- GET /quotes: Returns a random quote in JSON format.
{
"title": "The Matrix",
"phrase": "I know what you're thinking, 'cause I'm thinking the same thing.",
"character": "Neo",
"poster": "matrix_poster.jpg"
}- Spring Boot: Framework for building the REST API.
- Spring Data JPA: For database interactions.
- PostgreSQL: Database for storing quotes.
- Docker and Docker Compose: For containerizing and running the application and PostgreSQL database.
- Ensure you have Docker, Docker Compose, and Maven installed.
- Build the application:
./mvnw clean package - Start the application and database:
docker-compose up --build - Test the API:
curl http://localhost:8080/quotes
MADE BY: Natan Leal
Esta é uma API REST desenvolvida com Spring Boot que permite aos usuários obter citações aleatórias. A aplicação utiliza PostgreSQL como banco de dados para armazenar citações, cada uma contendo:
- Title: O título da fonte da citação (ex.: filme, livro).
- Phrase: O texto da citação em si.
- Character: O personagem que disse a citação.
- Poster: Uma referência ao pôster ou imagem relacionada à citação.
- GET /quotes: Retorna uma citação aleatória em formato JSON.
{
"title": "The Matrix",
"phrase": "Eu sei o que você está pensando, porque estou pensando a mesma coisa.",
"character": "Neo",
"poster": "matrix_poster.jpg"
}- Spring Boot: Framework para construção da API REST.
- Spring Data JPA: Para interações com o banco de dados.
- PostgreSQL: Banco de dados para armazenamento das citações.
- Docker e Docker Compose: Para containerizar e executar a aplicação e o banco de dados PostgreSQL.
- Certifique-se de ter Docker, Docker Compose e Maven instalados.
- Construa a aplicação:
./mvnw clean package - Inicie a aplicação e o banco de dados:
docker-compose up --build - Teste a API:
curl http://localhost:8080/quotes
FEITO POR: Natan Leal