⚡ Nexus Core
Inspiration
Planning a meeting for a team spread across continents is a logistical nightmare. It often involves dozens of open browser tabs, complex spreadsheets, and biased guesswork based on one or two "obvious" cities. We were inspired to build a tool that does this heavy lifting instantly, finding the truly optimal location based on data.
The Durhack "Man-in-the-Middle" theme gave us our core challenge: what if the very data you rely on—like airport locations, flight routes, or costs—is secretly corrupted or misleading? We wanted to build an app that wasn't just "smart," but resilient.
What it does
Nexus Core is an AI-powered calculator that finds the single best meeting location for a group of global attendees.
Input: Users enter their starting locations (e.g., LHR, JFK, DUR) and their desired travel date.
Smart Filtering: The app's "Smart Sampling" AI first identifies the group's geographic center. It then intelligently analyzes the most relevant hubs (e.g., the 1000 closest) instead of wasting time on random locations across the globe.
Complex Analysis: It calculates the best travel plan (factoring in 0-stop vs. 1-stop flights) and scores each hub based on user-defined priorities, including:
Cost: A predictive seasonality model adjusts prices based on the time of year and adds surcharges for major holidays.
Time: The total travel time, including penalties for layovers.
Convenience: A score based on the average number of stops.
CO₂ Emissions: The total environmental impact.
Fairness: The variance in travel time, ensuring no one attendee is overly burdened.
Connectivity: The number of routes connected to that hub.
Output: The result is a simple, powerful dashboard showing the winning location, a Top 10 list, an interactive map of the travel routes, and a detailed itinerary.
AI Summary: A "Generate AI Summary" button uses the Gemini API to write a professional, one-paragraph executive summary of the findings, perfect for sharing with a team.
How we built it
Nexus Core is a self-contained web app built entirely in Python, using Streamlit for the interactive frontend.
Data Engine: The core logic relies on Pandas and NumPy for high-speed data manipulation, handling over 70,000+ flight routes and 6,000+ global hubs.
MITM Pipeline: We built a robust "Anti-MITM" data cleaning pipeline that loads, validates, and cleans corrupted datasets (e.g., .dat files with bad coordinates, missing IDs, or string-based numbers) against trusted ground-truth data from OpenFlights on startup.
Analysis AI: The app's "Smart Sampling" uses a haversine-based geographic centroid filter. The routing logic simulates direct vs. 1-stop flights, and the cost model predicts seasonal price changes.
Visualization: All map visualizations are rendered using Folium.
Reporting AI: The executive summary feature is powered by a direct API call to Google's gemini-2.5-flash-preview-09-2025 model.
Challenges we ran into
Our biggest challenge was building a system robust enough to handle the "Man-in-the-Middle" theme.
Data Corruption: Our initial data pipeline failed constantly. We had to debug 'Unknown codes' (caused by hidden whitespace and case-sensitivity issues), TypeError crashes (from string-based coordinates), and EmptyDataError from blank files.
Faulty Logic: Our first analysis model gave random results because we were using np.random.rand() as a placeholder for a "connectivity" score. We fixed this by building a real connectivity score based on route counts.
"The Dubai Bug": Our most critical logic flaw was exposed by testing JFK, JFK, DUR. The app returned Dubai! This was because our "Smart Sampling" was excluding attendee start locations. We fixed this to correctly analyze all hubs, allowing JFK to win as the obvious choice.
Caching: We had to master Streamlit's @st.cache_data and session state. After fixing a major bug, the app still gave the wrong answer because it was "remembering" the old, broken data. We had to learn to "bust the cache" to force the app to use our new, correct logic.
Accomplishments that we're proud of
The "Smart Sampling" (Geographic Centroid) Filter: This is our biggest win. Instead of analyzing 1000 random global hubs, the app intelligently finds the 1000 closest hubs to the group's center. This makes the results faster and far more relevant.
The Predictive Seasonality Model: We're very proud of this. It goes beyond simple estimates to model travel costs based on the time of year, including peak-season and holiday surcharges, making the "Total Cost" metric feel realistic and accurate.
The "Fast vs. Slow" UI: The app's architecture separates the heavy, one-time calculation (the "slow" part) from the lightweight weighting and sorting (the "fast" part). This allows the user to move the priority sliders and instantly see the Top 10 list re-rank, which makes the app feel incredibly responsive and powerful.
What we learned
This project was a masterclass in data resilience and iterative design.
Data is Never Clean: We learned that a robust data cleaning pipeline is the most important, foundational part of any analytics app.
Logic is Complex: A "simple" idea like "find the best meeting spot" hides immense logical complexity. We had to account for 0-stop vs. 1-stop flights, seasonality, geographic filtering, and user-input errors to make the results logical.
UI/UX is Everything: A "correct" answer isn't useful if the app feels "random" or slow. Separating the heavy calculations (button press) from the lightweight sorting (slider movement) was a breakthrough in making the app feel smart.
What's next for Nexus Core
The current app is a powerful proof-of-concept. The next steps would be to replace our models with live data.
Live Price Integration: Integrate a real-time, paid API (like Skyscanner or Amadeus) to replace our predictive model with live flight and train pricing.
Live Ground Transport: Integrate the Google Maps Distance Matrix API to replace our simple "Drive" model with real-time driving duration and routing.
Venue & Booking Integration: Connect to hotel and venue APIs (e.g., Booking.com) to allow users to not only find the best city, but to find and book the best conference room or hotel all within the Nexus Core platform.

Log in or sign up for Devpost to join the conversation.