How 2025-meichuhackathon-team-yee-da-tuo/backend works
Project type and purpose
• This is a backend-only RESTful API service (no frontend code in the repo).
• Its primary responsibility is user management (register/login), trades, and fuzzy search over some dataset.
• It exposes HTTP endpoints under /api/*.
File structure
• Top level:
• main.py – application entrypoint.
• api/ – routing layer: auth.py, trade.py, fuzzy_search.py.
• core/ – business‐logic utilities: db.py (database session), graph_manager.py.
• models/ – data definitions: user_model.py, user_schema.py.
• requirements.txt – third‐party dependencies.
• No separate frontend; MVC‐style separation:
View = API endpoints,
Controller/Service = core/graph_manager & db,
Model = models/.
README for additional insights
• Describes two endpoints: user registration and login.
• Base URL http://127.0.0.1:8000.
• While only auth endpoints are documented, existence of trade.py and fuzzy_search.py implies further business features.
Detail
• Flow of data through Pydantic schemas into SQLAlchemy models.
• If graph_manager.py interfaces with a graph database or in‐memory graph, represent that as well.
• Don’t oversimplify: show each endpoint group, each core utility, and the DB.
1) Client
↓
2) main.py (ASGI entrypoint)
↓
3) API Layer
├─ Auth Module (api/auth.py)
├─ Trade Module (api/trade.py)
└─ Fuzzy Search Module (api/fuzzy_search.py)
↓
4) Business Logic Layer
├─ DB Session Manager (core/db.py)
└─ Graph Manager (core/graph_manager.py)
↓
5) Data Layer
├─ User Model & Schema (models/)
└─ Database (PostgreSQL or SQLite)
←– Responses flow back up the same path