A full-stack application that provides AI-powered transit recommendations with ridership predictions and personalized incentives.
Latest: v0.2.1 (December 2025) — See CHANGELOG.md for details
For Developers: See CONTEXT.md for architecture and code patterns
✅ Phase 1: Model Service Optimization - COMPLETE
✅ Phase 2: Next.js API Gateway Enhancements - COMPLETE
✅ Phase 3: Frontend UI/UX Improvements - COMPLETE
✅ Phase 4: Repository Clean-up & Documentation - COMPLETE
✅ Phase 5: Investor Demo Enhancements - COMPLETE
# Clone and start the application
git clone <repository-url>
cd tryp_transit_v0.2
./start-app.sh
cd model_service
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
# Start the service
python app.py
Requires Node.js ≥ 22 (the openai 7 SDK needs it; CI uses Node 22).
cd src
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env.local
# Edit .env.local with your API keys
# Start development server
npm run dev
# Lint (ESLint 9 CLI; `next lint` was removed in Next 16)
npm run lint
Narration can use Gemini or OpenAI. Set LLM_PROVIDER=gemini|openai|none; when it's unset, the legacy USE_GEMINI=true|false still selects the provider. Numbers never come from the LLM: with no key (or none), trips still return deterministic figures with template narration.
src/.env.local)# AI Provider - choose one
USE_GEMINI=true
GEMINI_API_KEY="your_gemini_api_key_here"
# GEMINI_MODEL="" # optional override; blank or unset = gemini-3.8-flash
# OR
# USE_GEMINI=false
# OPENAI_API_KEY="your_openai_api_key_here"
# OPENAI_MODEL="" # optional override; blank or unset = gpt-5.6-terra
# Traffic Data (server-only; the legacy NEXT_PUBLIC_TOMTOM_API_KEY name is still read as a fallback)
TOMTOM_API_KEY="your_tomtom_api_key_here"
# Demo scenarios (investor walkthroughs) are off unless this is "true"
# NEXT_PUBLIC_DEMO_MODE=true
The web app doesn't call model_service (P1, F-07); see src/.env.example for every setting.
model_service/.env - Optional)FLASK_ENV="development"
FLASK_DEBUG="false" # default false; enable only for local debugging
API_HOST="127.0.0.1" # default; use 0.0.0.0 only inside a container
API_PORT="5001" # default
GET /api/health)/api/transit-insights{
"departure": { "lat": 40.7128, "lng": -74.0060 },
"destination": { "lat": 40.7589, "lng": -73.9851 },
"timeToDestination": "14:30"
}
{
"travelTime": 25,
"trafficDensity": "Medium",
"costSavingsPerTrip": "3.45",
"nudgeMessage": "Taking the bus instead of driving will save you $3.45 and reduce your carbon footprint by 2.1 lbs CO2!",
"incentiveDetails": {
"type": "eCredit",
"description": "Earn $1.50 transit credit for choosing public transportation",
"value": "$1.50"
},
"additionalRides": [...]
}
npm run lint = eslint ., flat config in src/eslint.config.mjs; next lint was removed in Next 16)cd src
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
npm run typecheck # Type-check (tsc --noEmit)
npm run lint # ESLint CLI (flat config); `next build` no longer lints, so CI runs this separately
./start-app.sh# Test health endpoint
curl http://localhost:5001/health
# Test prediction endpoints
curl http://localhost:5001/predict/hourly/5
curl http://localhost:5001/predict/daily/7
tryp_transit_v0.2/
├── src/ # Next.js frontend application
│ ├── app/ # App router pages and API routes
│ │ ├── api/
│ │ │ ├── transit-insights/ # Main API endpoint (Gemini/OpenAI)
│ │ │ └── transit-insights-demo/# Mock endpoint for demos
│ │ ├── find-rides/ # Main trip planning page
│ │ ├── dashboard/ # User dashboard
│ │ └── ...
│ ├── components/ # Reusable UI components
│ │ └── ui/ # Shadcn/ui primitives
│ ├── lib/ # Utilities and shared code
│ │ └── api/ # API clients (gemini, openai, tomtom)
│ ├── contexts/ # React context providers
│ ├── types/ # TypeScript interfaces
│ ├── __tests__/ # Jest test suite
│ ├── .env.example # Environment template
│ └── package.json
├── model_service/ # Python Flask ML service
│ ├── app.py # Flask server (port 5001)
│ ├── bus_hourly_chronos_t5_tiny.py # Hourly predictions
│ ├── bus_daily_chronos_t5_tiny.py # Daily predictions
│ ├── data/ # CSV data files
│ └── requirements.txt # Pinned Python dependencies
├── start-app.sh # Automated startup script
├── stop-app.sh # Cleanup script
├── CONTEXT.md # Developer/AI context guide
├── CHANGELOG.md # Version history
├── REFACTORING_PLAN.md # Refactoring documentation
└── README.md # This file
This MVP is investor-ready with:
Port 5001 in use
./stop-app.sh # Stop existing services
./start-app.sh # Restart fresh
Missing API Keys
src/.env.local with valid API keysPython Dependencies
cd model_service
rm -rf venv
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
Frontend Build Issues
cd src
rm -rf node_modules
npm install
npm run build
| Document | Purpose |
|---|---|
| README.md | Quick start and overview |
| CONTEXT.md | Architecture and code patterns for developers/AI |
| CHANGELOG.md | Version history and changes |
| SETUP.md | Detailed installation guide |
| DEMO_CHECKLIST.md | Investor demo preparation |
| REFACTORING_PLAN.md | Technical debt and improvements |
Total Implementation Time: ~4 hours of focused development Features Delivered: AI-powered transit recommendations with full-stack integration Investor Ready: Beautiful UI, real-time data, and scalable architecture
A full-stack application that provides AI-powered transit recommendations with ridership predictions and personalized incentives.
Latest: v0.2.1 (December 2025) — See CHANGELOG.md for details
For Developers: See CONTEXT.md for architecture and code patterns
✅ Phase 1: Model Service Optimization - COMPLETE
✅ Phase 2: Next.js API Gateway Enhancements - COMPLETE
✅ Phase 3: Frontend UI/UX Improvements - COMPLETE
✅ Phase 4: Repository Clean-up & Documentation - COMPLETE
✅ Phase 5: Investor Demo Enhancements - COMPLETE
# Clone and start the application
git clone <repository-url>
cd tryp_transit_v0.2
./start-app.sh
cd model_service
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
# Start the service
python app.py
Requires Node.js ≥ 22 (the openai 7 SDK needs it; CI uses Node 22).
cd src
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env.local
# Edit .env.local with your API keys
# Start development server
npm run dev
# Lint (ESLint 9 CLI; `next lint` was removed in Next 16)
npm run lint
Narration can use Gemini or OpenAI. Set LLM_PROVIDER=gemini|openai|none; when it's unset, the legacy USE_GEMINI=true|false still selects the provider. Numbers never come from the LLM: with no key (or none), trips still return deterministic figures with template narration.
src/.env.local)# AI Provider - choose one
USE_GEMINI=true
GEMINI_API_KEY="your_gemini_api_key_here"
# GEMINI_MODEL="" # optional override; blank or unset = gemini-3.8-flash
# OR
# USE_GEMINI=false
# OPENAI_API_KEY="your_openai_api_key_here"
# OPENAI_MODEL="" # optional override; blank or unset = gpt-5.6-terra
# Traffic Data (server-only; the legacy NEXT_PUBLIC_TOMTOM_API_KEY name is still read as a fallback)
TOMTOM_API_KEY="your_tomtom_api_key_here"
# Demo scenarios (investor walkthroughs) are off unless this is "true"
# NEXT_PUBLIC_DEMO_MODE=true
The web app doesn't call model_service (P1, F-07); see src/.env.example for every setting.
model_service/.env - Optional)FLASK_ENV="development"
FLASK_DEBUG="false" # default false; enable only for local debugging
API_HOST="127.0.0.1" # default; use 0.0.0.0 only inside a container
API_PORT="5001" # default
GET /api/health)/api/transit-insights{
"departure": { "lat": 40.7128, "lng": -74.0060 },
"destination": { "lat": 40.7589, "lng": -73.9851 },
"timeToDestination": "14:30"
}
{
"travelTime": 25,
"trafficDensity": "Medium",
"costSavingsPerTrip": "3.45",
"nudgeMessage": "Taking the bus instead of driving will save you $3.45 and reduce your carbon footprint by 2.1 lbs CO2!",
"incentiveDetails": {
"type": "eCredit",
"description": "Earn $1.50 transit credit for choosing public transportation",
"value": "$1.50"
},
"additionalRides": [...]
}
npm run lint = eslint ., flat config in src/eslint.config.mjs; next lint was removed in Next 16)cd src
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
npm run typecheck # Type-check (tsc --noEmit)
npm run lint # ESLint CLI (flat config); `next build` no longer lints, so CI runs this separately
./start-app.sh# Test health endpoint
curl http://localhost:5001/health
# Test prediction endpoints
curl http://localhost:5001/predict/hourly/5
curl http://localhost:5001/predict/daily/7
tryp_transit_v0.2/
├── src/ # Next.js frontend application
│ ├── app/ # App router pages and API routes
│ │ ├── api/
│ │ │ ├── transit-insights/ # Main API endpoint (Gemini/OpenAI)
│ │ │ └── transit-insights-demo/# Mock endpoint for demos
│ │ ├── find-rides/ # Main trip planning page
│ │ ├── dashboard/ # User dashboard
│ │ └── ...
│ ├── components/ # Reusable UI components
│ │ └── ui/ # Shadcn/ui primitives
│ ├── lib/ # Utilities and shared code
│ │ └── api/ # API clients (gemini, openai, tomtom)
│ ├── contexts/ # React context providers
│ ├── types/ # TypeScript interfaces
│ ├── __tests__/ # Jest test suite
│ ├── .env.example # Environment template
│ └── package.json
├── model_service/ # Python Flask ML service
│ ├── app.py # Flask server (port 5001)
│ ├── bus_hourly_chronos_t5_tiny.py # Hourly predictions
│ ├── bus_daily_chronos_t5_tiny.py # Daily predictions
│ ├── data/ # CSV data files
│ └── requirements.txt # Pinned Python dependencies
├── start-app.sh # Automated startup script
├── stop-app.sh # Cleanup script
├── CONTEXT.md # Developer/AI context guide
├── CHANGELOG.md # Version history
├── REFACTORING_PLAN.md # Refactoring documentation
└── README.md # This file
This MVP is investor-ready with:
Port 5001 in use
./stop-app.sh # Stop existing services
./start-app.sh # Restart fresh
Missing API Keys
src/.env.local with valid API keysPython Dependencies
cd model_service
rm -rf venv
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
Frontend Build Issues
cd src
rm -rf node_modules
npm install
npm run build
| Document | Purpose |
|---|---|
| README.md | Quick start and overview |
| CONTEXT.md | Architecture and code patterns for developers/AI |
| CHANGELOG.md | Version history and changes |
| SETUP.md | Detailed installation guide |
| DEMO_CHECKLIST.md | Investor demo preparation |
| REFACTORING_PLAN.md | Technical debt and improvements |
Total Implementation Time: ~4 hours of focused development Features Delivered: AI-powered transit recommendations with full-stack integration Investor Ready: Beautiful UI, real-time data, and scalable architecture