How minhe51805/hdbank_team works
Project Type and Purpose
• Type: Full-stack, end-to-end financial assistant combining Web UI (React), Backend API (Node.js/Express), AI/ML + LLM (Python), Blockchain logging (Solidity/Hardhat), and Zalo Bot integration (FastAPI).
• Purpose: Provide personalized financial recommendations, record advice immutably on-chain, and offer multi-channel access (Web + Zalo).
File Structure
a. Top-level directories:
– blockchain/ (Solidity contracts, Hardhat config, deploy scripts)
– server/ (Express REST API, on-chain hooks, explorer endpoints)
– hdbank-react/ (React + TypeScript frontend)
– notebooks & models (Python Jupyter notebooks for training & LLM chat)
– zalo_bot_integration.py & related scripts (FastAPI webhook for Zalo Bot)
– docker-compose.yml (Postgres setup)
b. Patterns:
– Layered separation (Frontend ↔ API ↔ ML ↔ Blockchain ↔ Messaging)
– Event hooks for on-chain logging
– Use of Docker/Hardhat for local dev environments
README Insights
• 4 main layers:
1) Frontend (React/TS)
2) Backend API (Node/Express + ethers.js + Postgres)
3) AI/ML & LLM (Python, scikit-learn, joblib, Jupyter, Gemini LLM)
4) Blockchain (Solidity, Hardhat)
5) Zalo Bot (Python FastAPI)
• Data flow: Notebook → PostgreSQL → Backend /signals/offer → Frontend UI → Hooks → AdviceLog on-chain
• Additional: explorer endpoints, Docker-compose for Postgres, Tailscale funnel for webhook exposure
Relationships & Data Flows
• Web UI → HTTP JSON → Backend /signals/offer → Postgres
• Backend on user action → ethers.js → Hardhat node → AdviceLog event
• Notebook training → writes predictions to Postgres
• Frontend polls /signals/offer & /advice/logs for Explorer
• Zalo Bot message → FastAPI webhook → CashyBear chat LLM → Backend log hook → Blockchain
• Backend explorer APIs read on-chain events → Frontend Explorer page
Architectural Patterns & Principles
– Separation of concerns: UI, API, ML, Blockchain, Messaging
– Event-driven extension: hooks to capture user actions
– Microservice‐style boundaries: each layer can be containerized
– Immutable logging: write-only blockchain contract events
– Data caching & model artifacts managed separately