Skip to content

coinfxpro/algolabweb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlgolabWeb API

AlgolabWeb, Algolab trading platformu için geliştirilmiş bir REST API'dir.

Gereksinimler

  • Python 3.8 veya üzeri
  • pip (Python paket yöneticisi)
  • Git

Kurulum

  1. Repoyu klonlayın:
git clone https://github.com/coinfxpro/algolabweb.git
cd algolabweb
  1. (Ö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
  1. Gereksinimleri yükleyin:
pip install -r requirements.txt

Çalıştırma

Geliştirme Ortamı

python3 app.py

Uygulama varsayılan olarak http://localhost:8000 adresinde çalışacaktır.

API dokümantasyonuna http://localhost:8000/docs adresinden erişebilirsiniz.

Production Ortamı

# Gunicorn ile çalıştırma (önerilen)
pip install gunicorn
gunicorn app:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000

API Endpoints ve Örnek Kullanım

1. Kullanıcı Girişi

curl -X POST http://localhost:8000/login \
  -H "Content-Type: application/json" \
  -d '{"username":"your_username","password":"your_password"}'

2. SMS Doğrulama

curl -X POST http://localhost:8000/verify-sms \
  -H "Content-Type: application/json" \
  -d '{"sms_code":"123456"}'

3. Hesap Bilgileri

curl -X GET http://localhost:8000/account-info

4. Emir Gönderme

curl -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"
  }'

5. Çıkış Yapma

curl -X POST http://localhost:8000/logout

Sunucu Kurulumu

Sistem Gereksinimleri

  • Minimum 1 CPU
  • En az 2GB RAM
  • 20GB disk alanı
  • Ubuntu 20.04 LTS veya üzeri (önerilen)

Sistem Servisi Olarak Çalıştırma (Ubuntu/Debian)

  1. Servis dosyası oluşturun:
sudo nano /etc/systemd/system/algolabweb.service
  1. 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
  1. Servisi başlatın:
sudo systemctl start algolabweb
sudo systemctl enable algolabweb

Güvenlik Önerileri

  • UFW veya benzeri bir firewall kullanın
  • Sadece gerekli portları açın (8000)
  • Reverse proxy (nginx) kullanın
  • SSL sertifikası ekleyin

Hata Ayıklama

  1. Port 8000 zaten kullanımda hatası:
sudo lsof -i :8000  # Portu kullanan process'i bul
sudo kill -9 PID    # Process'i sonlandır
  1. Permission denied hatası:
# Dosya izinlerini düzelt
sudo chown -R your_user:your_user /path/to/algolabweb
chmod -R 755 /path/to/algolabweb

API Dokümantasyonu

Detaylı API dokümantasyonuna aşağıdaki URL'lerden erişebilirsiniz:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Lisans

Bu proje MIT lisansı altında lisanslanmıştır.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages