TripRep is a Django web app for travelers who want one place to store and review trip tickets and do much more.
You can upload ticket PDFs, store trip details, view a clean list of past tickets, and track simple spending statistics. In addition, TripRep comes
with AI agents that can help you book flight tickets, create itineraries, and help answer travel questions.
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 ticket management:
- User signup, login, logout, and profile updates
- Ticket creation with manual entry fields
- Ticket 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
- Basic statistics page (ticket count and spending)
- 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
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 name, email, and password
- After signup/login, go to
/dashboard/
- Go to
/add_ticket/ - Upload a ticket PDF
- Fill in title, source, destination, type, booked-through, date, and amount
- Submit to save ticket
- 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
Open /statistics/ to see:
- Total ticket count
- Total spending amount
- Counts grouped by ticket type
Main user-facing routes from core/urls.py:
/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/tickets/ticket listing/add_ticket/add ticket form/create_ticket/AI extraction endpoint (POST)/save_ticket/save ticket endpoint (POST)/view_ticket/<ticket_id>/ticket details/delete_ticket/<ticket_id>/delete ticket/statistics/ticket statistics/reservations/reservations page (currently minimal)
- 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. A practical workflow:
- Create a feature branch
- Make focused changes
- Run migrations/tests as needed
- Open a pull request with a clear description of behavior changes