How jing-jung/2-jing-jung-community-be works
This is a FastAPI backend for an Animal Crossing-themed community, combining account and post APIs, live room chat, restaurant recommendations, and turnip trading. A client request enters the application or a feature router, then reaches business logic and persistence; WebSocket chat also broadcasts through Redis. The source excerpts show these core paths, while CVR analysis and weight optimization are present in the tree but their behavior and wiring are not shown. README-described scaling and observability integrations are preserved where supported, but deployment infrastructure is outside this runtime map.
Main entry points: main.py FastAPI Application · controllers.py Community Logic · routes.py Community Routes · cache.py Redis Cache
Components 23
API Runtime
- FastAPI Application
app/main.py - Community Routes
app/routers/routes.py - Recommendation API
app/routers/chat.py - CVR Analyzer
app/routers/cvr_analyzer.py - Weight Optimizer
app/routers/optimize_weights.py
Community Features
- Community Logic
app/services/controllers.py - Community Models
app/models/model.py - Session & Auth
app/services/controllers.py - Posts & Comments
app/services/controllers.py - Turnip Market
app/services/controllers.py
Realtime & Discovery
- Room Chat
app/main.py - Restaurant Recommender
app/routers/chat.py
Platform Services
- Configuration
app/core/config.py - Database Manager
app/core/database.py - DB Session Factory
app/db.py - Redis Cache
app/core/cache.py - Security Utilities
app/core/security.py - API Dependencies
app/core/dependencies.py - Structured Logging
app/core/logging.py - Prometheus Metrics
app/core/metrics.py
Other components
- Community Client
- MySQL Database
- Redis Service
Connections 24
- Community Client → FastAPI Application: sends requests
README.md - FastAPI Application → Community Routes: registers routes
app/main.py - FastAPI Application → Recommendation API: registers routes
app/main.py - Community Routes → Community Logic: calls
app/routers/routes.py - Community Routes → DB Session Factory: gets sessions
app/routers/routes.py - Community Routes → Redis Cache: reads cache
app/routers/routes.py - Community Logic → MySQL Database: queries
app/services/controllers.py - DB Session Factory → MySQL Database: opens sessions
app/db.py - Community Models → DB Session Factory: uses base
app/models/model.py - Community Logic → Session & Auth: authenticates users
app/services/controllers.py - Community Logic → Posts & Comments: handles content
app/services/controllers.py - Community Logic → Turnip Market: handles trades
app/services/controllers.py - FastAPI Application → Room Chat: hosts endpoint
app/main.py - Room Chat → Database Manager: opens sessions
app/main.py - Room Chat → Redis Cache: checks sessions
app/main.py - Room Chat → Redis Service: publishes messages
app/main.py - Recommendation API → Restaurant Recommender: gets recommendations
app/routers/chat.py - Redis Cache → Redis Service: reads and writes
app/core/cache.py - FastAPI Application → Database Manager: uses manager
app/main.py - FastAPI Application → Prometheus Metrics: serves metrics
app/main.py - Database Manager → Configuration: loads settings
app/core/database.py - Redis Cache → Configuration: loads settings
app/core/cache.py - Security Utilities → Configuration: loads settings
app/core/security.py - Structured Logging → Configuration: loads settings
app/core/logging.py