mod http; mod io; mod llm; mod state; mod store; use crate::http::build_routes; use crate::http::context::AppContext; use crate::state::SessionState; use crate::store::JsonFileStore; use poem::Server; use poem::listener::TcpListener; use std::path::PathBuf; use std::sync::Arc; #[tokio::main] async fn main() -> Result<(), std::io::Error> { let app_state = Arc::new(SessionState::default()); let store = Arc::new( JsonFileStore::from_path(PathBuf::from("store.json")).map_err(std::io::Error::other)?, ); let ctx = AppContext { state: app_state, store, }; let app = build_routes(ctx); Server::new(TcpListener::bind("127.0.0.1:3001")) .run(app) .await }