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
+45
View File
@@ -0,0 +1,45 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Rarity {
#[default]
Bronze,
Silver,
Gold,
RareGold,
Totw,
Hero,
Icon,
}
/// A card definition loaded from JSON data files.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CardDefinition {
pub id: String,
pub name: String,
pub overall: u8,
pub position: String,
pub nation: String,
pub league: String,
pub club: String,
pub pace: u8,
pub shooting: u8,
pub passing: u8,
pub dribbling: u8,
pub defending: u8,
pub physical: u8,
pub rarity: Rarity,
pub image_path: Option<String>,
}
/// A card instance owned by a club (stored in DB).
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow)]
pub struct OwnedCard {
pub id: String,
pub club_id: String,
pub card_id: String,
pub is_loan: bool,
pub loan_matches_remaining: Option<i64>,
pub acquired_at: String,
}