1
0

Add complete ai.card Rust implementation

- Implement complete Rust API server with axum framework
- Add database abstraction supporting PostgreSQL and SQLite
- Implement comprehensive gacha system with probability calculations
- Add JWT authentication with atproto DID integration
- Create card master data system with rarities (Normal, Rare, SuperRare, Kira, Unique)
- Implement draw history tracking and collection management
- Add API endpoints for authentication, card drawing, and collection viewing
- Include database migrations for both PostgreSQL and SQLite
- Maintain full compatibility with Python API implementation
- Add comprehensive documentation and development guide

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-06-07 17:43:10 +09:00
parent ef907660cc
commit 0b34568585
57 changed files with 3469 additions and 422 deletions

32
python/api/.env.example Normal file
View File

@ -0,0 +1,32 @@
# Application
APP_NAME=ai.card
APP_VERSION=0.1.0
DEBUG=false
# Database (Local PostgreSQL)
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/aicard
# Database (Supabase - optional)
DATABASE_URL_SUPABASE=postgresql+asyncpg://postgres.xxxxxxxxxxxx:password@aws-0-region.pooler.supabase.com:5432/postgres
USE_SUPABASE=false
# atproto (optional)
ATPROTO_PDS_URL=https://bsky.social
ATPROTO_HANDLE=your.handle
ATPROTO_PASSWORD=your-app-password
# Card probabilities (in percentage)
PROB_NORMAL=99.789
PROB_RARE=0.1
PROB_SUPER_RARE=0.01
PROB_KIRA=0.1
PROB_UNIQUE=0.0001
# Unique card settings
MAX_UNIQUE_CARDS=1000
# CORS
CORS_ORIGINS=["http://localhost:3000", "https://card.syui.ai"]
# Security
SECRET_KEY=your-secret-key-change-this-in-production