travel-api

API para registro de planos de viagem baseado no universo de Rick and Morty

Travel API

Description

API developed for a code challenge built using Crystal, Kemal, Jennifer, and Postgres. The objective of the API is to register travel plans using locations from the Rick and Morty universe. In addition to registration, it's possible to retrieve the registered data and use optimization and expansion parameters to return organized results based on data present in the external "Rick and Morty API."

🔨 Features

  • Get(/travel_plans): to retrieve all plans from the database.

  • Get(/travel_plans/:id): to retrieve the plan with the specified ID.

  • Post(/travel_plans): to save new plans. The request body is a JSON object like:

    { 
        "travel_stops": [1,2]
    }
    
  • Put(/travel_plans/:id): to update the plan with the specified ID. The body is a JSON object like:

    { 
        "travel_stops": [1,2,4,6]
    }
    
  • Delete(/travel_plans/:id): to delete the plan with the specified ID.

Additional features:

  • Optimization: The GET routes accept the 'optimize' parameter to adjust the order of the 'travel_stops' array based on popularity criteria.

  • Expansion: The GET routes accept the 'expand' parameter to provide additional details (name, type, dimension) for each 'travel_stop' in the response. Example usage: /travel_plans/1?optimize=true&expand=true

⚙️ Configuration

To use this application, simply download the project or clone this repository. Once done, navigate to the root directory and execute the following command in the terminal:

    docker-compose up

Please ensure that you have Docker properly installed on your local environment.

✔️ Techniques and Technologies Used

  • Crystal
  • Kemal
  • Jennifer ORM
  • Postgres
  • Docker

🔗 Credits

😄 Author

  • Jônathan Faria
Repository

travel-api

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 4
  • 7 months ago
  • September 26, 2023
License

MIT License

Links
Synced at

Sun, 19 May 2024 21:59:21 GMT

Languages