GithubHelp home page GithubHelp logo

quotes-api's Introduction

๐Ÿ“– 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.

quotes-api's People

Contributors

rubenvp2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.