AlgolabWeb, Algolab trading platformu için geliştirilmiş bir REST API'dir.
- Python 3.8 veya üzeri
- pip (Python paket yöneticisi)
- Git
- Repoyu klonlayın:
git clone https://github.com/coinfxpro/algolabweb.git
cd algolabweb- (Önerilen) Virtual environment oluşturun:
# Linux/Mac için
python3 -m venv venv
source venv/bin/activate
# Windows için
python -m venv venv
.\venv\Scripts\activate- Gereksinimleri yükleyin:
pip install -r requirements.txtpython3 app.pyUygulama varsayılan olarak http://localhost:8000 adresinde çalışacaktır.
API dokümantasyonuna http://localhost:8000/docs adresinden erişebilirsiniz.
# Gunicorn ile çalıştırma (önerilen)
pip install gunicorn
gunicorn app:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000curl -X POST http://localhost:8000/login \
-H "Content-Type: application/json" \
-d '{"username":"your_username","password":"your_password"}'curl -X POST http://localhost:8000/verify-sms \
-H "Content-Type: application/json" \
-d '{"sms_code":"123456"}'curl -X GET http://localhost:8000/account-infocurl -X POST http://localhost:8000/submit-order \
-H "Content-Type: application/json" \
-d '{
"symbol": "GARAN",
"quantity": 100,
"side": "BUY",
"price": 20.50,
"order_type": "limit"
}'curl -X POST http://localhost:8000/logout- Minimum 1 CPU
- En az 2GB RAM
- 20GB disk alanı
- Ubuntu 20.04 LTS veya üzeri (önerilen)
- Servis dosyası oluşturun:
sudo nano /etc/systemd/system/algolabweb.service- Aşağıdaki içeriği ekleyin:
[Unit]
Description=AlgolabWeb FastAPI Application
After=network.target
[Service]
User=your_user
WorkingDirectory=/path/to/algolabweb
Environment="PATH=/path/to/venv/bin"
ExecStart=/path/to/venv/bin/gunicorn app:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000
[Install]
WantedBy=multi-user.target- Servisi başlatın:
sudo systemctl start algolabweb
sudo systemctl enable algolabweb- UFW veya benzeri bir firewall kullanın
- Sadece gerekli portları açın (8000)
- Reverse proxy (nginx) kullanın
- SSL sertifikası ekleyin
- Port 8000 zaten kullanımda hatası:
sudo lsof -i :8000 # Portu kullanan process'i bul
sudo kill -9 PID # Process'i sonlandır- Permission denied hatası:
# Dosya izinlerini düzelt
sudo chown -R your_user:your_user /path/to/algolabweb
chmod -R 755 /path/to/algolabwebDetaylı API dokümantasyonuna aşağıdaki URL'lerden erişebilirsiniz:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Bu proje MIT lisansı altında lisanslanmıştır.