A hands-on blockchain learning suite composed of three cohesive apps:
- ChainLite (Backend API): Minimal blockchain with mining, blocks, transactions, nodes, and consensus.
- ChainLiteMobile (Mobile App): Interactive learning modules for mining, P2P, block explorer, and consensus.
- Admin Web (Dashboard): Real-time monitoring and admin UI for nodes, blocks, and transactions.
ChainLite/— FastAPI backend API and blockchain logicChainLiteMobile/— React Native + Expo mobile app (TypeScript)admin-web/— React Admin + MUI dashboard (Vite)
- Backend: FastAPI, Uvicorn/Gunicorn, Pydantic, MongoDB (PyMongo), Jinja2
- Mobile: React Native, Expo Router, TypeScript, Axios, SecureStore
- Admin: React 18, React Admin v4, MUI v5, Vite, Yarn
- The backend (
ChainLite/) exposes REST endpoints for transactions, mining, chain queries, node registration, and consensus. - The mobile app (
ChainLiteMobile/) consumes the same API. Default base URL:https://chainlite.onrender.com. Override viaEXPO_PUBLIC_API_BASE_URLor in-app Settings. - The admin dashboard (
admin-web/) reads from the API via a data provider; configure withVITE_API_URL.
Key backend endpoints (see ChainLite/app/main.py):
- Health:
GET /health,GET /readyz - Transactions:
POST /transactions,GET /transactions/latest,GET /transactions/{hash} - Mining:
GET /mine,GET /mining/status - Chain:
GET /chain,GET /blocks/latest,GET /blocks/{height} - Wallet:
GET /balance/{address} - Nodes & Consensus:
GET /nodes,POST /nodes/register,DELETE /nodes/{node_id},GET /nodes/resolve
Path: ChainLite/
Requirements: Python 3.9+, MongoDB (or compatible connection string)
# from ChainLite/
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# environment (examples)
export LOG_LEVEL=INFO
export MONGODB_URI="<your_mongodb_uri>" # if required by database.py
# run (dev)
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# run (prod)
# gunicorn -k uvicorn.workers.UvicornWorker app.main:appCORS is enabled for local dev and known frontends in app/main.py.
Path: ChainLiteMobile/
# from ChainLiteMobile/
yarn # or npm install
# optional: override API base URL
EXPO_PUBLIC_API_BASE_URL="http://<api-host>:8000" npx expo start
# start
npx expo startHighlights (see ChainLiteMobile/README.md):
- Modules: Mining, Network Builder, Block Explorer, Consensus Challenge
- API URL priority: env > SecureStore (in-app Settings) > default
https://chainlite.onrender.com - Structure:
app/(Expo Router),components/,src/services/blockchain.ts
Android APK via EAS:
npm i -g eas-cli
eas login && eas build:configure
eas build -p android --profile previewPath: admin-web/
# from admin-web/
yarn install
# .env
cat > .env <<'EOF'
VITE_API_URL=https://chainlite.onrender.com
EOF
# run
yarn dev # http://localhost:5173
# build
yarn buildKey files:
src/resources/— Blocks, Nodes, Transactions resourcessrc/dataProvider.js— API integration (set base URL, auth if needed)
- Start the backend (ensure DB reachable). Verify
GET /health. - Point Mobile and Admin to the backend URL:
- Mobile:
EXPO_PUBLIC_API_BASE_URLor in-app Settings. - Admin:
.envVITE_API_URL.
- Mobile:
- Test end-to-end:
POST /transactions→GET /mine→GET /chain.- Confirm updates in Mobile (Mining/Explorer) and Admin (Blocks/Tx/Nodes).
- Backend:
uvicorn app.main:app --reload - Mobile:
npx expo start,npm run android,npm run ios - Admin:
yarn dev,yarn build
Issues and PRs are welcome across all three apps. For significant changes, please open a discussion to align on API contracts and shared resources.
MIT License (see individual package licenses if present).