Tek tıkla GitHub repository oluşturan PHP uygulaması.
github_repo_creator/
├── index.php ← Ana sayfa (form + giriş)
├── callback.php ← GitHub OAuth callback
├── create_repo.php ← API endpoint (repo oluştur)
├── logout.php ← Oturum kapat
└── README.md
- GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
- Doldur:
- Application name:
Repo Creator - Homepage URL:
http://localhost:8000 - Authorization callback URL:
http://localhost:8000/callback.php
- Application name:
- Client ID ve Client Secret al
Yöntem A — Environment Variables (Önerilen):
export GITHUB_CLIENT_ID="your_client_id"
export GITHUB_CLIENT_SECRET="your_client_secret"Yöntem B — index.php ve callback.php içinde doğrudan:
define('GITHUB_CLIENT_ID', 'your_client_id');
define('GITHUB_CLIENT_SECRET', 'your_client_secret');# PHP Built-in Server
cd github_repo_creator
php -S localhost:8000
# Apache/Nginx: klasörü web root'a koyhttp://localhost:8000
- GitHub ile Giriş Yap butonuna tıkla
- GitHub izinlerini onayla
- Formu doldur:
- Repository adı (zorunlu)
- Açıklama (isteğe bağlı)
- Public / Private seç
- README.md otomatik oluştur (isteğe bağlı)
- Repository Oluştur butonuna tıkla
- Clone URL'yi kopyala, repoya git!
- OAuth 2.0 state parametresi ile CSRF koruması
- Token session'da saklanır (production'da encrypted session önerilir)
- Repo adı input validation ile temizlenir
- PHP 7.4+
allow_url_fopen = On(php.ini)- HTTPS (production ortamı için zorunlu)