Backend: - Add XP, level, streak fields to User model - Add tier, category, xp_reward fields to Badge model - Create gamification service with XP, levels, streaks, badge checking - Add gamification router with level progress, leaderboard endpoints - Define 16 badge types across attendance, ratings, social, milestones Frontend: - LevelProgressCard component with XP bar and streak display - XPLeaderboard component showing top users - Integrate level progress into profile page Slug System: - All entities now support slug-based URLs - Performances use songslug-YYYY-MM-DD format
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
from fastapi import FastAPI
|
|
from routers import auth, shows, venues, songs, social, tours, artists, preferences, reviews, badges, nicknames, moderation, attendance, groups, users, search, performances, notifications, feed, leaderboards, stats, admin, chase, gamification
|
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
app = FastAPI()
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"], # In production, set this to the frontend domain
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(auth.router)
|
|
app.include_router(shows.router)
|
|
app.include_router(venues.router)
|
|
app.include_router(songs.router)
|
|
app.include_router(social.router)
|
|
app.include_router(tours.router)
|
|
app.include_router(artists.router)
|
|
app.include_router(preferences.router)
|
|
app.include_router(reviews.router)
|
|
app.include_router(badges.router)
|
|
app.include_router(nicknames.router)
|
|
app.include_router(moderation.router)
|
|
app.include_router(attendance.router)
|
|
app.include_router(groups.router)
|
|
app.include_router(users.router)
|
|
app.include_router(search.router)
|
|
app.include_router(performances.router)
|
|
app.include_router(notifications.router)
|
|
app.include_router(feed.router)
|
|
app.include_router(leaderboards.router)
|
|
app.include_router(stats.router)
|
|
app.include_router(admin.router)
|
|
app.include_router(chase.router)
|
|
app.include_router(gamification.router)
|
|
|
|
@app.get("/")
|
|
def read_root():
|
|
return {"Hello": "World"}
|
|
|
|
@app.get("/healthz")
|
|
def health_check():
|
|
"""Health check endpoint for monitoring and load balancers"""
|
|
return {"status": "healthy"}
|
|
|