mod brewery; mod event; mod food_truck; use brewery::Brewery; use event::Event; use food_truck::FoodTruck; #[cfg(feature = "gui")] use eframe::{epaint::Vec2, run_native, NativeOptions}; // use tailwag::gui::widgets::item_manager::item_manager::ItemManager; use tailwag::orm::data_manager::rest_api::RestApiDataProvider; // use tailwag_gui_tools::widgets::widget_selector::MultiItemManager; use tailwag_web_service::application::WebService; #[tokio::main] async fn main() { let svc = WebService::builder("Brewery Food Truck Finder") .with_resource::() .with_resource::() .with_resource::() // .with_webhook("/brewery/{id}/") .build_service(); // let gui_thread = tokio::spawn(run_gui()); // _ = run_gui().await; svc.run().await.expect("App failed to exit gracefully"); // _ = gui_thread.await; } // /// Experimental: Launches an egui application for managing the items by calling hte API. // /// Commented out since the GUI features are not yet released. // async fn run_gui() { // let provider = // RestApiDataProvider::::from_endpoint("http://localhost:8081".to_string()); // // Uncomment to run without the web service (e.g. if Postgres isn't set up) // // let provider = InMemoryDataProvider::::default(); // let app = MultiItemManager::default() // .add("Breweries", ItemManager::from_data_provider(provider.clone())) // .add("Food Trucks", ItemManager::from_data_provider(provider)); // // Standard egui shit // let native_options = NativeOptions { // initial_window_size: Some(Vec2::new(640.0, 480.0)), // ..Default::default() // }; // run_native("Breweries", native_options, Box::new(|_| Box::new(app))) // .expect("Application crashed."); // }