Skip to content

About

An API Rest quote generator that gives random quotes based on the information on the database

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

QuotesGenerator

A quote generator API built with Spring Boot that provides random quotes from a PostgreSQL database.


English

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.

Available Endpoints:

  • GET /quotes: Returns a random quote in JSON format.

Example Response:

{
  "title": "The Matrix",
  "phrase": "I know what you're thinking, 'cause I'm thinking the same thing.",
  "character": "Neo",
  "poster": "matrix_poster.jpg"
}

Technologies Used:

  • 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.

How to Run:

  1. Ensure you have Docker, Docker Compose, and Maven installed.
  2. Build the application: ./mvnw clean package
  3. Start the application and database: docker-compose up --build
  4. Test the API: curl http://localhost:8080/quotes

MADE BY: Natan Leal


Português

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.

Endpoints Disponíveis:

  • GET /quotes: Retorna uma citação aleatória em formato JSON.

Exemplo de Resposta:

{
  "title": "The Matrix",
  "phrase": "Eu sei o que você está pensando, porque estou pensando a mesma coisa.",
  "character": "Neo",
  "poster": "matrix_poster.jpg"
}

Tecnologias Utilizadas:

  • 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.

Como Executar:

  1. Certifique-se de ter Docker, Docker Compose e Maven instalados.
  2. Construa a aplicação: ./mvnw clean package
  3. Inicie a aplicação e o banco de dados: docker-compose up --build
  4. Teste a API: curl http://localhost:8080/quotes

FEITO POR: Natan Leal

About

An API Rest quote generator that gives random quotes based on the information on the database

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages