Requirements:
- Ubuntu 20.04+ server
- 4GB RAM minimum
- PostgreSQL 12+
- Redis 6+
- Nginx
Steps:
- Install dependencies:
sudo apt update
sudo apt install python3 python3-pip nodejs npm postgresql redis-server nginx- Clone and setup:
git clone https://github.com/quantsingularity/BlockScore.git
cd BlockScore
./scripts/setup_blockscore_env.sh- Configure environment:
cd code/backend
cp .env.example .env
# Edit .env with production values- Start with Gunicorn:
cd code/backend
source venv/bin/activate
gunicorn -w 4 -b 0.0.0.0:5000 app:app- Configure Nginx:
server {
listen 80;
server_name api.blockscore.io;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}docker-compose up -dUse Ansible playbooks in infrastructure/ansible/:
cd infrastructure/ansible
ansible-playbook -i inventory/hosts.yml playbooks/main.yml- Use PostgreSQL (not SQLite)
- Enable HTTPS/TLS
- Configure Redis for caching
- Set strong SECRET_KEY and JWT_SECRET_KEY
- Enable rate limiting
- Setup monitoring (Prometheus/Grafana)
- Configure backups
- Use environment variables for secrets
- Enable audit logging
- Setup firewall rules
Monitor these metrics:
- API response times
- Error rates
- Database connection pool
- Credit score calculation latency
- Blockchain transaction success rate
See Configuration Guide for production settings.