Skip to content

โ›ˆ๏ธ๐ŸŒค๏ธ Personal trip planner integrating weather data from OpenWeater's Public API

License

Notifications You must be signed in to change notification settings

javieramayapat/travel-planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“‘ Travel Planner ๐Ÿ“‘

โ›ˆ๏ธ๐ŸŒค๏ธ Personal trip planner integrating weather data from OpenWeater's Public API

Table of Contents

๐Ÿš€ Demo

Demo

System Design

travel-planner-design

Entity-Relationship Diagram

Daily Pet Facts

In order to see the application I created my own relationship model, identifying a one-to-many relationship between users and trips.

Managing a foreign key user_id for the connection between the users table to the trips table.

Why all NOT NULL? Users: In users I limited to place only basic fields, but of relevance of the users, getting to restrict some as unique as are the user name and mail, as this way I make sure not to have duplicity in this table.

trips: In trips, having to know when and where a person leaves a place and where he will arrive and his arrival date, I knew I could not build a trip without this information.

In the case of the dates I handled them in timestamp format to know the date and time of departure and arrival of the traveler, since a restriction is that the entire trip can not last more than 8 days equivalent to (192 hours), then a solution that could be implemented, would be through a query to make a summation of the total time of the trips and if it exceeds the limit of 192 to alert the user that the travel time is going to be exceeded.

Database SQL

My bases for choosing a related database are:

  • I have knowledge of the types of data I am going to store, plus they are related to each other.
  • Besides being able to relate more entities:
    • example: that I can link a trip with types of transports I will use or the type of luggage I should carry per trip would be superb.
  • I have a better understanding of how they work and they allow me to be flexible with queries.

๐Ÿ’กFeatures

Here're some of the projects's best features:

  • Endpoint to retrive all the travels โœ…
  • Endpoint to retrive the detail of a travel โœ…
  • Endpoint to create a travel โœ…
  • Endpoint to retrive weater forecast โœ…
  • Implementation of container technologies โœ…

๐Ÿง‘โ€๐Ÿ’ป Installation Steps

  1. Clone the repository

  2. Create your virtual enviromen with the command py -m venv venv

  3. Install requirements in your virtual enviroment pip install -r requirements.txt

  4. Create the env file in the root of the project .env and copy the content of the .env.example to configurate environment variables.

  5. Note: if you want to consult the forecast by city, I recommend you to register in the platforma OpenWeater, get and API KEY and add in you file .env to access to this infromation.

  6. You can run the following command to buil the image. $ docker-compose build

  7. Once the image is built, run the container: $ docker-compose up -d

  8. If you want to be faster in launching the project you can use the following command to perform the above two steps in one. $ docker-compose up --build

  9. Now go to http://127.0.0.1:8000/docs and enjoy the app.

The process

๐Ÿ—๏ธ Build with

Technologies used in this project:

To get started you just need to download docker on your machine, I leave the link right here. โžก๏ธ Docker.

Licence

This project is licensed under the MIT License

Author

Made with ๐Ÿ’™ by javieramayapat

About

โ›ˆ๏ธ๐ŸŒค๏ธ Personal trip planner integrating weather data from OpenWeater's Public API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published