QuantDog is an intelligent quantum threat detection and adaptive cryptographic routing platform that protects cryptocurrency transactions from quantum computer attacks.
QuantDog now uses a modern microservices architecture:
- Backend: FastAPI for high-performance async API
- Frontend: React with TypeScript for responsive UI
- Real-time: WebSocket connections for live threat monitoring
- Python 3.9 or higher
- Node.js 18 or higher
- Git
-
Clone the repository
git clone https://github.com/boshyxd/QuantDog.git cd QuantDog -
Backend Setup
# Install UV (ultra-fast Python package manager) curl -LsSf https://astral.sh/uv/install.sh | sh # Install Python dependencies make install # Copy environment variables cp .env.example .env
-
Frontend Setup
cd frontend npm install cd ..
# Terminal 1 - Backend API
make run-api
# Terminal 2 - Frontend
make run-frontend# Backend API (http://localhost:8000)
uv run uvicorn api:app --reload
# Frontend (http://localhost:3000)
cd frontend && npm startOnce the backend is running, visit:
- Interactive API docs: http://localhost:8000/docs
- API schema: http://localhost:8000/openapi.json
make install # Install dependencies with UV
make run-api # Run FastAPI backend
make lint # Run linter (auto-fix enabled)
make format # Format code
make test # Run tests with coverage
make update # Update all dependencies
make clean # Clean cache filescd frontend
npm start # Start development server
npm test # Run tests
npm run build # Build for production
npm run lint # Run linterQuantDog/
βββ api/ # FastAPI specific modules
β βββ routes.py # API endpoints
β βββ websocket.py # WebSocket handlers
β βββ models.py # Pydantic models
βββ core/ # Business logic (shared)
β βββ threat_detector.py
β βββ router.py
β βββ monitoring.py
βββ services/ # External integrations
β βββ blockchain.py
β βββ crypto.py
β βββ quantum.py
βββ frontend/ # React application
β βββ src/
β βββ public/
β βββ package.json
βββ main.py # FastAPI entry point
βββ Makefile # Development commands
Key environment variables in .env:
QUANTUM_THREAT_LOW/MEDIUM/HIGH: Threat level thresholdsHONEYPOT_CHECK_INTERVAL: How often to check honeypots (seconds)ETHEREUM_RPC_URL: Ethereum RPC endpointBITCOIN_RPC_URL: Bitcoin RPC endpoint
The API broadcasts real-time threat updates via WebSocket:
// Connect to WebSocket
const ws = new WebSocket('ws://localhost:8000/ws');
// Listen for threat updates
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'threat_update') {
console.log('Threat level:', data.data.threat_level);
console.log('Active crypto:', data.data.active_crypto);
}
};make test
# Or: uv run pytest tests/ -v --cov=core --cov=services --cov=utilscd frontend && npm test# Kill process on port 8000 (backend)
lsof -ti:8000 | xargs kill -9
# Kill process on port 3000 (frontend)
lsof -ti:3000 | xargs kill -9# Reinstall backend dependencies
uv sync --reinstall
# Reinstall frontend dependencies
cd frontend && rm -rf node_modules && npm installEnsure the backend is running before starting the frontend. The API is configured to accept requests from localhost:3000 and localhost:5173.