feat(core): implement full memory pipeline (#11)

This commit is contained in:
2026-08-24 01:37:16 +00:00
parent 46d382e6cc
commit af6f22217d
19 changed files with 2235 additions and 259 deletions
+13 -4
View File
@@ -90,13 +90,20 @@ enum Commands {
Serve {
#[arg(long, default_value = "8080")]
port: u16,
#[arg(long, default_value = "test-key")]
api_key: String,
#[arg(long)]
api_key: Option<String>,
#[arg(long)]
database_url: Option<String>,
},
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Initialize logging
tracing_subscriber::fmt()
.with_max_level(tracing::Level::INFO)
.init();
let cli = Cli::parse();
match cli.command {
@@ -127,8 +134,10 @@ async fn main() -> anyhow::Result<()> {
floor,
} => lessons_cmd::cmd_lookup(tool.as_deref(), cmd.as_deref(), file.as_deref(), floor)?,
Commands::Materialize => lessons_cmd::cmd_materialize()?,
Commands::Serve { port, api_key } => {
http_server::start_server(port, api_key).await?
Commands::Serve { port, api_key, database_url } => {
let api_key = api_key.unwrap_or_else(|| std::env::var("MEM_API_KEY").unwrap_or_else(|_| "test-key".to_string()));
let database_url = database_url.unwrap_or_else(|| std::env::var("DATABASE_URL").unwrap_or_else(|_| "postgresql://app:poimen@localhost:5432/memory".to_string()));
http_server::start_server(port, api_key, &database_url).await?
}
}