- Python 3.11+
- Node.js 18+ (for frontend)
- 2GB RAM minimum
tar -xzf nautilus-admin-complete.tar.gz
cd nautilus-admin-completepip install nautilus_trader fastapi uvicornpython3 nautilus_api.pyBackend will start on http://localhost:8000
curl http://localhost:8000/api/healthExpected response:
{
"status": "healthy",
"message": "Nautilus Trader Admin API is running"
}Open test_api_frontend.html in your browser to verify integration.
pip install gunicorn
gunicorn nautilus_api:app \
--workers 4 \
--worker-class uvicorn.workers.UvicornWorker \
--bind 0.0.0.0:8000 \
--access-logfile - \
--error-logfile -Create /etc/systemd/system/nautilus-api.service:
[Unit]
Description=Nautilus Trader API
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/path/to/nautilus-admin
ExecStart=/usr/bin/python3 nautilus_api.py
Restart=always
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable nautilus-api
sudo systemctl start nautilus-apiCreate Dockerfile:
FROM python:3.11-slim
WORKDIR /app
RUN pip install nautilus_trader fastapi uvicorn gunicorn
COPY nautilus_api.py .
COPY nautilus_instance.py .
EXPOSE 8000
CMD ["gunicorn", "nautilus_api:app", \
"--workers", "4", \
"--worker-class", "uvicorn.workers.UvicornWorker", \
"--bind", "0.0.0.0:8000"]Build and run:
docker build -t nautilus-admin-api .
docker run -d -p 8000:8000 nautilus-admin-apicd sprint5-deliverable
npm installCreate .env:
VITE_API_URL=http://your-api-domain.com:8000npm run buildInstall nginx:
sudo apt install nginxCreate /etc/nginx/sites-available/nautilus-admin:
server {
listen 80;
server_name your-domain.com;
root /path/to/nautilus-admin/sprint5-deliverable/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}Enable and restart:
sudo ln -s /etc/nginx/sites-available/nautilus-admin /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxNo environment variables required for basic setup.
Optional:
NAUTILUS_LOG_LEVEL- Set log level (default: INFO)NAUTILUS_PORT- API port (default: 8000)
Required in .env:
VITE_API_URL- Backend API URL
Update nautilus_api.py:
app.add_middleware(
CORSMiddleware,
allow_origins=["https://your-frontend-domain.com"], # Specific domain
allow_credentials=True,
allow_methods=["GET", "POST"], # Specific methods
allow_headers=["*"],
)Add authentication middleware (example with JWT):
from fastapi import Depends, HTTPException, status
from fastapi.security import HTTPBearer
security = HTTPBearer()
async def verify_token(credentials = Depends(security)):
# Implement token verification
pass
@app.get("/api/protected")
async def protected_route(token = Depends(verify_token)):
# Protected endpoint
passUse Let's Encrypt with Certbot:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com# API health
curl http://localhost:8000/api/health
# Engine status
curl http://localhost:8000/api/nautilus/engine/info# View API logs
tail -f /var/log/nautilus-api.log
# View nginx logs
tail -f /var/log/nginx/access.log
tail -f /var/log/nginx/error.logAdd to nautilus_api.py:
from prometheus_fastapi_instrumentator import Instrumentator
Instrumentator().instrument(app).expose(app)# Check port availability
sudo lsof -i :8000
# Check Python version
python3 --version # Should be 3.11+
# Check dependencies
pip list | grep nautilus
pip list | grep fastapi# Clear cache
rm -rf node_modules package-lock.json
npm install
# Check Node version
node --version # Should be 18+- Check
allow_originsinnautilus_api.py - Verify
VITE_API_URLin frontend.env - Check browser console for specific error
- Verify API is running:
curl http://localhost:8000/api/health - Check firewall:
sudo ufw status - Check nginx config:
sudo nginx -t
Use load balancer (nginx, HAProxy) with multiple API instances:
upstream nautilus_api {
server localhost:8001;
server localhost:8002;
server localhost:8003;
}
server {
location /api {
proxy_pass http://nautilus_api;
}
}- Use PostgreSQL connection pooling
- Implement Redis caching
- Optimize Parquet queries
Use Cloudflare, AWS CloudFront, or similar for static assets.
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/backups/nautilus-admin"
# Backup database
pg_dump nautilus > $BACKUP_DIR/db_$DATE.sql
# Backup config
tar -czf $BACKUP_DIR/config_$DATE.tar.gz /path/to/config
# Backup logs
tar -czf $BACKUP_DIR/logs_$DATE.tar.gz /var/log/nautilus-api.log# Restore database
psql nautilus < db_backup.sql
# Restore config
tar -xzf config_backup.tar.gz -C /- Increase worker count:
--workers 8 - Use Redis for caching
- Enable gzip compression
- Enable code splitting
- Lazy load components
- Use CDN for assets
- Add indexes
- Optimize queries
- Use connection pooling
For issues or questions:
- Check logs first
- Review documentation
- Test with
test_api_frontend.html - Check GitHub issues (if applicable)
Version: 1.0.0 Last Updated: October 19, 2025