Get BlockScore up and running in 3 simple steps. This guide assumes you have the prerequisites installed.
Before starting, ensure you have:
- ✅ Python 3.8+ (
python3 --version) - ✅ Node.js 16+ (
node --version) - ✅ MongoDB running (
mongod --version) - ✅ Git (
git --version)
# Clone the repository
git clone https://github.com/quantsingularity/BlockScore.git
cd BlockScore
# Run automated setup script
./scripts/setup_blockscore_env.shThis script will:
- Create Python virtual environments for AI models and backend
- Install all Node.js dependencies for backend and frontend
- Prepare the development environment
# Copy example environment files
cp code/backend/.env.example code/backend/.env
cp web-frontend/.env.example web-frontend/.env
# Edit backend configuration (minimal required)
nano code/backend/.envMinimal .env configuration:
# Database
DATABASE_URL=sqlite:///blockscore.db
# Security (change these!)
SECRET_KEY=your-secret-key-here
JWT_SECRET_KEY=your-jwt-secret-here
# Blockchain (optional for local development)
BLOCKCHAIN_PROVIDER_URL=http://localhost:8545
CONTRACT_ADDRESS=0x0000000000000000000000000000000000000000# Option A: Use the run script (recommended)
./scripts/run_blockscore.sh
# Option B: Start services manually
# Terminal 1 - Backend API
cd code/backend
source venv_blockscore_backend_py/bin/activate
python app.py
# Terminal 2 - Web Frontend
cd web-frontend
npm startOpen your browser and navigate to:
- Web Frontend: http://localhost:3000
- Backend API: http://localhost:5000/api/health
You should see:
- Frontend: BlockScore dashboard login page
- Backend: JSON health check response
Expected health check response:
{
"success": true,
"status": "healthy",
"version": "1.0.0",
"services": {
"database": "up",
"redis": "not_configured",
"blockchain": "down",
"ai_model": "up"
}
}# Using curl
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "SecurePass123!"
}'# Login first to get access token
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "SecurePass123!"
}'
# Calculate credit score (replace TOKEN with your access token)
curl -X POST http://localhost:5000/api/credit/calculate-score \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
}'Visit http://localhost:3000 and:
- Register a new account
- Connect your wallet (MetaMask recommended)
- View your credit profile
- Explore credit score factors
Solution: Check prerequisites are installed
python3 --version # Should be 3.8+
node --version # Should be 16+
npm --version # Should be 8+Solution: Stop conflicting service or change port
# Find process using port 5000
lsof -i :5000
# Kill the process (replace PID)
kill -9 PID
# Or change Flask port in code/backend/app.py
# app.run(host="0.0.0.0", port=5001, debug=True)Solution: Verify SQLite or configure PostgreSQL
# For SQLite (default), ensure write permissions
chmod 755 code/backend/
# For PostgreSQL, update DATABASE_URL in .env
DATABASE_URL=postgresql://user:password@localhost:5432/blockscoreSolution: Check proxy configuration
# Verify web-frontend/package.json has:
"proxy": "http://localhost:5000"
# Restart frontend after changes
cd web-frontend && npm start- Read the Usage Guide - Learn common workflows
- Explore API Documentation - Integrate with your applications
- Review Configuration Guide - Advanced configuration options
- Check Examples - Working code samples
- Check Troubleshooting Guide
- Review logs in
code/backend/directory - Open an issue on GitHub