Skip to content

larsboes/optimized-bahn-msghackathon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plan Bahn

Python FastAPI Vue.js LangGraph uv Docker

AI-powered Deutsche Bahn travel assistant with real-time data, intelligent routing, and delay predictions.

Quick Start

Docker (Recommended)

git clone https://github.com/larsboes/optimized-bahn-msghackathon && cd optimized-bahn-msghackathon
cp src/backend/.env.example src/backend/.env  # Add your API keys
docker compose up

Project Structure

src/
├── backend/          # FastAPI + LangGraph (Python)
│   ├── domain/       # Business entities
│   ├── use_cases/    # Application logic
│   ├── interfaces/   # Abstract repositories
│   ├── infrastructure/  # Concrete implementations
│   ├── service/      # Legacy service layer
│   └── agent/        # AI agent with tools
├── frontend/         # Vue 3 + Vuetify
└── data-loader/      # GTFS/NeTEx ingestion service

Tech Stack

Component Technology
Backend FastAPI, LangGraph, Pydantic
Frontend Vue 3, Vuetify, Pinia
AI/LLM Google Gemini, LangGraph ReAct
Database SQLite (GTFS data), PostgreSQL (planned)
Data Deutsche Bahn Timetables API, GTFS, NeTEx
DevOps Docker Compose, uv

Project Status

This project started as a hackathon MVP and is being modernized for production use.

Done

  • Docker Compose setup (backend, frontend, data-loader, PostgreSQL, Redis)
  • Data loader service with extensible loader architecture
  • Clean Architecture folder structure (domain, use_cases, interfaces, infrastructure)
  • Real-time integration with DB Timetables API
  • LangGraph AI agent with tool calling
  • Vue 3 frontend with chat interface
  • GTFS data ingestion pipeline
  • Network graph for pathfinding suggestions

In Progress

  • Migrate from SQLite to PostgreSQL + PostGIS
  • Redis session management (currently in-memory)
  • Full station search in AI agent (currently ~10 hardcoded stations)
  • Global error handling and structured logging

Planned

  • Refactor Docs: Reorganize and expand documentation for clarity
  • Backend Refactoring: Clean up legacy code and improve type safety
  • Frontend Refactoring: Consolidate components and improve performance
  • React + Bun Migration: Migrate from Vue 3 + npm to React + Bun
  • Advanced Routing: CSA (Connection Scan Algorithm) or Raptor for multi-hop connections
  • Historical Delays: ML predictions using piebro/deutsche-bahn-data
  • Platform-aware Transfers: Use NeTEx data for realistic transfer times
  • HashiCorp Vault: Enterprise secrets management

Known Limitations

  1. AI Agent Station Limit: Tool can only look up ~10 hardcoded stations (see src/backend/agent/tools.py)
  2. Routing: No automatic multi-hop routing (A→B→C→D); requires explicit "via" station
  3. Simulated Data: Wagon loads and some delays are randomized, not from real API
  4. Session Storage: In-memory only, doesn't persist across restarts

Documentation

For comprehensive documentation on architecture, setup, usage, and API reference, see docs/README.md.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Getting started with development
  • Code style and commit conventions
  • Testing requirements
  • Areas where help is needed
  • Bug reporting

License

See LICENSE file.

About

better Bahn journey planning :)

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 76.8%
  • Vue 17.3%
  • HTML 3.2%
  • JavaScript 1.9%
  • Dockerfile 0.5%
  • Mako 0.2%
  • SCSS 0.1%