Skip to content

Latest commit

Β 

History

History
48 lines (44 loc) Β· 2.67 KB

File metadata and controls

48 lines (44 loc) Β· 2.67 KB

πŸ“– Quotes API

πŸ—¨οΈ Description

This is a simple API that allows you to read quotes. All quotes are stored in a database and can be accessed through the API. The API is written in Java 17 and uses the Spring Boot framework. The database is a simple Postgresql database.
The data is provided by Kaggle and contains 500k quotes.
This project was created for learning purposes.

πŸ—ƒοΈ Technologies

  • Java 21 & Maven
  • Spring Boot
  • Swagger & OpenAPI
  • Postgresql
  • Docker & Docker Compose

πŸ“¦ Installation

βš™οΈ Environment variables

The following environment variables are required to run the API:

  • POSTGRES_USER: The username for the database
  • POSTGRES_PASSWORD: The password for the database

You need to set these variables in the docker-compose.yml file or create a .env file in the root directory.
Spring boot also requires this environment variables, they are set in the application.properties file.

πŸ‹ Docker

The easiest way to run the API is to use Docker.

  1. Clone the repository
  2. Create a .env file in the root directory and set the environment variables
  3. Change the localhost in the application.properties file to db
  4. Run docker-compose up in the root directory
  5. The API is now running on port 8080

✍️ Manual

If you don't want to use Docker, you can also run the API manually.

  1. Clone the repository
  2. Create a Postgresql database
  3. Set the environment variables
  4. Run mvn spring-boot:run in the root directory
  5. The API is now running on port 8080

If you want to get the data from Kaggle, you need to download the data and import it into the database. (The data is not included in this repository because it is too large) In SQL folder you can find the SQL file to create the table and import the data.

πŸ“œ Documentation

The API documentation is available at /swagger-ui/index.html when the API is running.

πŸͺͺ License

This project is licensed under the MIT License. See the LICENSE file for more information.