Skip to content

ChainLite Monorepo

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.

Repository Structure

  • ChainLite/ — FastAPI backend API and blockchain logic
  • ChainLiteMobile/ — React Native + Expo mobile app (TypeScript)
  • admin-web/ — React Admin + MUI dashboard (Vite)

Tech Stack

  • 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

How They Work Together

  • 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 via EXPO_PUBLIC_API_BASE_URL or in-app Settings.
  • The admin dashboard (admin-web/) reads from the API via a data provider; configure with VITE_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

Quick Start

1) Backend API — ChainLite

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:app

CORS is enabled for local dev and known frontends in app/main.py.


2) Mobile App — ChainLiteMobile

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 start

Highlights (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 preview

3) Admin Dashboard — admin-web

Path: 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 build

Key files:

  • src/resources/ — Blocks, Nodes, Transactions resources
  • src/dataProvider.js — API integration (set base URL, auth if needed)

Development Workflow

  1. Start the backend (ensure DB reachable). Verify GET /health.
  2. Point Mobile and Admin to the backend URL:
    • Mobile: EXPO_PUBLIC_API_BASE_URL or in-app Settings.
    • Admin: .env VITE_API_URL.
  3. Test end-to-end:
    • POST /transactionsGET /mineGET /chain.
    • Confirm updates in Mobile (Mining/Explorer) and Admin (Blocks/Tx/Nodes).

Scripts (Common)

  • Backend: uvicorn app.main:app --reload
  • Mobile: npx expo start, npm run android, npm run ios
  • Admin: yarn dev, yarn build

Contributing

Issues and PRs are welcome across all three apps. For significant changes, please open a discussion to align on API contracts and shared resources.


License

MIT License (see individual package licenses if present).

Popular repositories Loading

  1. ChainLiteMobile ChainLiteMobile Public

    TypeScript

  2. chainlite chainlite Public

    A minimal, educational blockchain with Python & FastAPI. Features proof-of-work, transaction management, and MongoDB persistence. Perfect for learning core blockchain concepts through a clean, well…

    Python

  3. admin-web admin-web Public

    A modern, responsive admin dashboard built with React Admin and Material-UI for managing and monitoring the ChainLite blockchain network. This admin interface provides a user-friendly way to intera…

    JavaScript

  4. .github .github Public

    ChainLite is a hands-on blockchain learning suite. This monorepo includes: ChainLite (FastAPI API with mining, blocks, transactions, nodes, and consensus), ChainLiteMobile (Expo React Native app wi…

Repositories

Showing 4 of 4 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…