Initial commit: OpenFUT Core

Offline Ultimate Team backend — game-independent REST API.

- 19 API endpoints: auth, profiles, clubs, cards, packs, squads,
  objectives, SBCs, match rewards, NPC market, statistics
- Axum + SQLite + SQLx with full migrations
- Weighted pack generator, SBC validation engine
- JSON-driven mod data (cards, packs, objectives, SBCs)
- 5 integration tests passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-25 14:52:06 -07:00
commit 1ffe0ffa9f
60 changed files with 6152 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
use anyhow::Result;
use openfut_core::{config, db, seed};
use tracing::info;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
#[tokio::main]
async fn main() -> Result<()> {
dotenvy::dotenv().ok();
tracing_subscriber::registry()
.with(
EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "openfut_core=debug,tower_http=debug".into()),
)
.with(tracing_subscriber::fmt::layer())
.init();
let cfg = config::Config::from_env()?;
info!("OpenFUT Core starting on {}", cfg.listen_addr);
let pool = db::init_pool(&cfg.database_url).await?;
db::run_migrations(&pool).await?;
seed::maybe_seed(&pool).await?;
let app = openfut_core::app::build(pool, cfg.clone()).await?;
let listener = tokio::net::TcpListener::bind(&cfg.listen_addr).await?;
info!("Listening on http://{}", cfg.listen_addr);
axum::serve(listener, app).await?;
Ok(())
}