TripRep is a Django web app for travelers who want one place to store and review trip tickets, reservations, and do much more.
You can upload ticket and reservation PDFs, organize them into trips, view clean lists and detail pages, record spending in any currency (auto-converted to INR), and track spending statistics. In addition, TripRep comes
with AI agents that can help you book flight tickets, create itineraries, and help answer travel questions (Currently In Progress).
The app also includes an AI-assisted flow that reads a ticket PDF and auto-fills ticket fields using Google Gemini.
- What TripRep Does
- Tech Stack
- Project Structure
- Getting Started
- Environment Variables
- Run the App
- How to Use TripRep
- Route Guide
- Troubleshooting
- Production and Security Notes
- Contributing
TripRep currently focuses on travel management:
- User signup, login, logout, profile updates, and password changes
- Per-user preferred currency, with amounts auto-converted to INR using daily exchange rates
- Ticket creation with manual entry fields, filled automatically with the help of AI after upload
- Reservation creation with manual entry fields
- Ticket/reservation PDF upload and thumbnail generation (first page preview)
- AI extraction endpoint to read uploaded PDF tickets and prefill fields
- Ticket list view and individual ticket detail pages with a quick-to-see image of the ticket
- Reservation list view and individual reservation detail pages
- Trip creation, plus linking tickets and reservations to a trip — from the add pages, a standalone attach page, or while creating the trip
- Trip detail page that lists attached tickets and reservations with a Tickets/Reservations/All filter
- Statistics page to get a glance at spending across platforms, flights, hotels, and more, plus a TripRep score
- AI agents to book tickets and create itineraries (in progress)
- Python 3
- Django 4.2+
- SQLite (default local database)
google-genaifor Gemini ticket parsing- PyMuPDF (
fitz) + Pillow for ticket thumbnail generation python-dotenvfor loading environment variables- Cached exchange rates (
static/core/exchange_rates.json) for multi-currency to INR conversion
TripRep/
├── manage.py
├── requirements.txt
├── README.md
├── TripRep/
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
└── core/
├── models.py
├── views.py
├── urls.py
├── forms.py
├── signals.py
├── templates/core/
└── static/
git clone <your-repo-url>
cd TripRepLinux/macOS:
python3 -m venv .venv
source .venv/bin/activateWindows PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1pip install -r requirements.txtCreate a .env file in the project root:
genai_api_key=YOUR_GOOGLE_GENAI_API_KEYImportant: the key name is genai_api_key (lowercase), matching TripRep/settings.py.
python manage.py migrateDuring migration, a default superuser is auto-created by core/signals.py:
- Username:
hrajora - Password:
hrajora
This is for local development only. Change or remove this behavior before any production use.
TripRep currently reads:
genai_api_key: API key used by the Gemini integration in ticket extraction.
If this is missing, AI ticket processing (/create_ticket/) will fail.
Start the development server:
python manage.py runserverOpen:
- App home:
http://127.0.0.1:8000/ - Login:
http://127.0.0.1:8000/login/ - Admin:
http://127.0.0.1:8000/admin/
- Visit
/signup/ - Register with email and password
- After signup/login, go to
/dashboard/
- Go to
/add_ticket/ - Upload a ticket PDF.
- Let the automatic parser fill all details automatically.
- Review and edit the title, source, destination, type, booked-through, date, and amount if required.
- Optionally attach the ticket to an existing trip using the trip dropdown.
- Submit to save ticket.
- Go to
/add_reservation/ - Upload a reservation PDF.
- Review and edit the fields.
- Optionally attach the reservation to an existing trip using the trip dropdown.
- Submit to save the reservation.
- On
/add_ticket/, select a PDF - Frontend JS posts the file to
/create_ticket/ - Backend calls Gemini, parses the response, and returns extracted fields
- Form fields auto-populate in the browser
- Submit to persist the ticket
- Open
/tickets/for your personal ticket list - Click a ticket to open
/view_ticket/<ticket_id>/ - View metadata, thumbnail, and downloadable file
- Delete a ticket from the ticket detail page if needed
- Go to
/add_trip/and fill in the trip name, description, type, and start/end dates - Optionally pick one unattached ticket and one unattached reservation to link
- Save the trip, then open it at
/view_trip/<trip_id>/ - On the trip page, use the Tickets/Reservations/All filter to review attached items
- You can also attach an existing ticket to a trip later from
/attach_trip/<ticket_id>/
Open /statistics/ to see a spending dashboard with charts, including:
- Total ticket count
- Total spending amount (in INR)
- Counts and spending grouped by ticket type and booking platform
Routes from core/urls.py:
Accounts and pages
/home page/about_triprep/about page/signup/user registration/login/user login/logout/user logout/dashboard/post-login dashboard/profile/profile page/update_profile/profile update action (POST)/updatepassword/change password/ai-world/AI features landing (in progress)
Tickets
/tickets/ticket listing/add_ticket/add ticket form/create_ticket/AI extraction endpoint (POST)/process_ticket_pdf/PDF processing endpoint/save_ticket/save ticket endpoint (POST)/view_ticket/<ticket_id>/ticket details/delete_ticket/<ticket_id>/delete ticket
Reservations
/reservations/reservation listing/add_reservation/add reservation form/save_reservation/save reservation endpoint (POST)/view_reservation/<reservation_id>/reservation details/delete_reservation/<reservation_id>/delete reservation
Trips
/trips/trip listing/add_trip/create a trip and optionally link a ticket/reservation/view_trip/<trip_id>/trip details with Tickets/Reservations/All filter/attach_trip/<ticketID>/attach an existing ticket to a trip
Statistics and misc
/statistics/spending statistics dashboard/statistics/data/statistics data endpoint (JSON, used by charts)/booking_saved/booking confirmation page/robots.txtrobots file
- Verify
.envexists in project root. - Confirm
genai_api_keyis valid. - Ensure uploaded file is a readable PDF.
- Check that PyMuPDF and Pillow installed correctly.
- Confirm uploaded file is not corrupted.
- Ensure media files are writable in your environment.
- Keep
DEBUG = Truefor local development. - Confirm URLs are loaded through Django (
/static/...,/media/...).
- Ensure migrations completed successfully.
- Use the default local superuser only for local testing or create a new user in admin.
Before deployment, update the following:
- Remove or secure auto-created default superuser in
core/signals.py. - Set a real
SECRET_KEYand move it to environment variables. - Set
DEBUG = False. - Set a proper
ALLOWED_HOSTSlist. - Configure production static/media serving.
- Review AI response parsing and add validation/error handling.
- Add logging instead of
printstatements.
Contributions are welcome! Please read the Contributing Guide for setup instructions, branching workflow, and the pre-PR checklist. A practical workflow:
- Create a feature branch
- Make focused changes
- Run
python manage.py checkand add migrations if models changed - Open a pull request with a clear description of behavior changes
By participating, you agree to follow our Code of Conduct. To report a security issue, see our Security Policy.