π΄ Travel Itinerary - FastAPI Project
LocalAbout π΄ Travel Itinerary - FastAPI Project
A FastAPI and SQLAlchemy backend for creating and browsing day-by-day travel itineraries. It also provides duration-based recommendations, with sample itineraries for Phuket and Krabi.
Key features
- 01Create day-by-day itineraries
- 02Browse and retrieve stored itineraries
- 03Recommend itineraries by trip duration
- 04Preloaded Phuket and Krabi data
- 05Swagger and ReDoc API documentation
Use cases
- 01Build a travel itinerary API
- 02Find itinerary options for a trip length
- 03Test endpoints through interactive API docs
MCP support
The MCP server recommends itineraries based on trip duration.
Configuration
Local server config is the same for every client. Copy it into your clientβs MCP config file.
We havenβt collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEπ΄ Travel Itinerary - FastAPI Project
This is a backend system for managing travel itineraries using FastAPI and SQLAlchemy, featuring RESTful APIs to create and view itineraries and an MCP server to recommend itineraries based on trip duration.
π Live Demo
π Live URL: https://travel-itinerary-fdwd.onrender.com/docs
π§° Tech Stack
- Python 3.11+
- FastAPI
- SQLAlchemy
- SQLite (for development; switchable to PostgreSQL)
- Uvicorn
- Render (for deployment)
- Pydantic (for input validation)
π¦ Features
- Create new itineraries with full day-wise breakdown
- View all stored itineraries
- MCP (Minimum Cost Path) server for recommending itineraries based on nights
- Pre-seeded data for Phuket and Krabi, Thailand
- Interactive Swagger UI for testing endpoints
π Folder Structure
travel-itinerary-backend/
β
βββ app/ # Main application package
β βββ __init__.py # Makes the app a Python package
β βββ main.py # Entry point of FastAPI app
β βββ models.py # SQLAlchemy models
β βββ database.py # DB connection setup
β βββ schemas.py # Pydantic schemas for validation
β βββ seed_data.py # Predefined itinerary data
β βββ routes/ # API route definitions
β βββ itineraries.py # CRUD routes for itineraries
β
βββ requirements.txt # Project dependencies
βββ README.md # Project documentation
βββ .gitignore # Files to ignore in Git
βββ start.sh # (Optional) Start script for deployment
βοΈ Features
- β Create travel itineraries with hotel, transfer, and excursion data
- β Get recommended itineraries for 2 to 8-night durations
- β Modular code with FastAPI, SQLAlchemy, and SQLite
- β Auto-generated Swagger and ReDoc API docs
- β Deployed live using Render
π Getting Started
π¦ 1. Clone the Repository
git clone https://github.com/ThasnimaShereef/Travel-Itinerary.git
cd Travel-Itinerary
π§ͺ 2. Create a Virtual Environment
python -m venv venv
# For Windows:
venv\Scripts\activate
# For macOS/Linux:
source venv/bin/activate
π₯ 3. Install Dependencies
pip install -r requirements.txt
βΆοΈ 4. Run the Development Server
uvicorn app.main:app --reload
Now visit: http://127.0.0.1:8000/docs for the Swagger UI.
π§ͺ API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /itineraries/ | Create a new itinerary |
| GET | /itineraries/ | Get all itineraries |
| GET | /itineraries/{id} | Get itinerary by id |
| GET | /recommendations/{duration} | Get recommended itinerary by duration |
πΈ Screenshots
π Swagger UI
π Itinerary JSON Response for GET /itenararies - All Itenararies
π Itinerary JSON Response for GET /itenararies/{id} - Itenarary based on id
π Itinerary JSON Response for POST /itenararies - Creating a new itenarary
π Itinerary JSON Response for GET /recommendations{duration} - Recommendation of itenararies based on the duration
π Deployment on Render
π 1. Push to GitHub
git init
git remote add origin https://github.com/ThasnimaShereef/Travel-Itinerary.git
git add .
git commit -m "Initial backend commit"
git push -u origin main --force
π 2. Deploy via Render
- Go to https://render.com
- Create a New Web Service
- Connect your GitHub repo
- Set the Build Command to:
pip install -r requirements.txt - Set the Start Command to:
uvicorn app.main:app --host 0.0.0.0 --port 10000 - Set Port to
10000 - β Deploy and wait for the live link!
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.