Add comprehensive README for Phase 1

This commit is contained in:
oguz ozturk 2026-01-10 16:33:02 +03:00
parent ec0164691b
commit c298116f09
1 changed files with 39 additions and 232 deletions

271
README.md
View File

@ -1,246 +1,53 @@
# 🚀 Hosting Platform - Automated DNS & SSL Management # 🚀 Hosting Platform - Professional WordPress Hosting
Modern, otomatik DNS ve SSL yönetim platformu. Cloudflare entegrasyonu ile domain'leri saniyeler içinde yapılandırın. Modern, modular hosting platform with container infrastructure and automated DNS management.
## 📋 Özellikler ## 🌐 Live URLs
### 🎯 Core Features - **Customer Portal**: https://argeict.net
- ✅ **Cloudflare Entegrasyonu**: API token ile otomatik DNS yönetimi - **API Backend**: https://api.argeict.net
- ✅ **DNS Önizleme**: Değişiklikleri uygulamadan önce görüntüleyin - **Git Repository**: https://gitea.argeict.net/hostadmin/hosting-platform
- ✅ **Otomatik SSL**: Cloudflare SSL/TLS yapılandırması
- ✅ **Load Balancer**: Hash-based IP dağıtımı
- ✅ **Modern UI**: React + Vite ile hızlı ve responsive arayüz
- ✅ **Auto-Deploy**: Git push ile otomatik deployment
- ✅ **PostgreSQL**: Güvenilir veri saklama
- ✅ **Redis**: Hızlı cache ve session yönetimi
### 🆕 Yeni Özellikler (v2.0) ## ✅ Phase 1: Foundation & Authentication (COMPLETED)
- ✨ **CF Account Management**: Admin panelden Cloudflare hesaplarını yönetin
- ✨ **Encrypted Token Storage**: API token'ları şifreli olarak saklama
- ✨ **DNS Nameserver Checker**: Gerçek zamanlı nameserver kontrolü
- ✨ **Advanced Domain Setup**: Gelişmiş domain kurulum sihirbazı
- ✨ **CF Token Guide**: Adım adım Cloudflare token oluşturma rehberi
- ✨ **Nameserver Instructions**: Kullanıcı dostu NS değiştirme talimatları
## 🏗️ Mimari ### Backend Features
- ✅ User authentication with JWT tokens
- ✅ User and Customer models with SQLAlchemy
- ✅ Secure password hashing with bcrypt
- ✅ Protected API routes with decorators
- ✅ Customer profile management
- ✅ Subscription plans and limits
``` ### Frontend Features
┌─────────────────────────────────────────────────────────┐ - ✅ Beautiful landing page with animations
│ Cloudflare CDN │ - ✅ Register/Login functionality
│ (SSL/TLS + DDoS Protection) │ - ✅ Customer dashboard with sidebar navigation
└─────────────────────────────────────────────────────────┘ - ✅ Auth context for global state management
- ✅ Protected routes
- ✅ Brand colors and design system from ARGE ICT logo
┌─────────────────────────────────────────────────────────┐
│ Nginx Reverse Proxy │
│ (176.96.129.77 - Load Balancer) │
└─────────────────────────────────────────────────────────┘
┌──────────────┴──────────────┐
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Frontend │ │ Backend │
│ React + Vite │ │ Flask API │
│ Port 3001 │ │ Port 5000 │
└───────────────┘ └───────────────┘
┌────────────────┴────────────────┐
▼ ▼
┌──────────────┐ ┌──────────────┐
│ PostgreSQL │ │ Redis │
│ Port 5432 │ │ Port 6379 │
└──────────────┘ └──────────────┘
```
## 🛠️ Teknolojiler ## 🎨 Design System
### Backend ### Brand Colors (from ARGE ICT logo)
- **Flask 3.0** - Modern Python web framework - **Primary Green**: #159052
- **SQLAlchemy 2.0** - ORM - **Dark Green**: #046D3F
- **PostgreSQL 16** - Database - **Light Green**: #53BA6F
- **Redis 7.0** - Cache & Sessions - **Orange**: #F69036
- **Cloudflare API** - DNS & SSL management - **Blue**: #0F578B
- **Red**: #B42832
### Frontend ## 🏗️ Tech Stack
- **React 18** - UI library
- **Vite** - Build tool
- **TailwindCSS** - Styling
- **Axios** - HTTP client
### DevOps **Backend**: Flask 3.0, SQLAlchemy 2.0, PostgreSQL, JWT, Redis
- **Gitea** - Git repository **Frontend**: React 18, Vite, TailwindCSS, React Router
- **Nginx** - Reverse proxy **DevOps**: Nginx, Supervisor, Let's Encrypt, Gitea
- **Supervisor** - Process management
- **Systemd** - Service management
## 📦 Kurulum ## 📋 Next Steps (Phase 2)
### Gereksinimler - Customer Dashboard - DNS Module integration
- Ubuntu 22.04+ - Domain management with customer isolation
- Python 3.12+ - Project creation wizard
- Node.js 18+
- PostgreSQL 16
- Redis 7.0
### Backend Kurulumu ## 📝 License
```bash
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Environment variables
cp .env.example .env
# .env dosyasını düzenleyin
# Database migration
flask db upgrade
# Başlatma
python app/main.py
```
### Frontend Kurulumu
```bash
cd frontend
npm install
npm run dev
```
## 🔧 Yapılandırma
### Environment Variables
```bash
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/hosting_db
# Redis
REDIS_URL=redis://localhost:6379/0
# API
API_HOST=0.0.0.0
API_PORT=5000
# Load Balancer IPs
LB_IPS=176.96.129.77,176.96.129.78,176.96.129.79
# Secret
SECRET_KEY=your-secret-key-here
```
## 🚀 API Endpoints
### Health Check
```bash
GET /health
```
### DNS Management
```bash
POST /api/dns/validate-token
POST /api/dns/preview-changes
POST /api/dns/apply-changes
POST /api/dns/check-nameservers # 🆕 Nameserver kontrolü
```
### Domain Management
```bash
GET /api/domains
GET /api/domains/<id>
POST /api/domains
PUT /api/domains/<id>
DELETE /api/domains/<id>
```
### Admin Endpoints (🆕)
```bash
GET /api/admin/cf-accounts # CF hesaplarını listele
POST /api/admin/cf-accounts # Yeni CF hesabı ekle
PUT /api/admin/cf-accounts/<id> # CF hesabını güncelle
DELETE /api/admin/cf-accounts/<id> # CF hesabını sil
```
## 📝 Lisans
MIT License - Detaylar için LICENSE dosyasına bakın.
## 👨‍💻 Geliştirici
Hosting Platform Team
---
## 🚀 Deployment
### 🔗 Auto-Deploy Webhook (Önerilen)
Gitea'ya webhook ekleyerek otomatik deployment yapabilirsiniz:
**Webhook URL**: `https://api.argeict.net/webhook/deploy`
Detaylı kurulum için: [WEBHOOK_SETUP.md](WEBHOOK_SETUP.md)
```bash
# Webhook test
curl -X POST https://api.argeict.net/webhook/deploy \
-H "Content-Type: application/json" \
-d '{"repository":{"name":"hosting-platform"}}'
```
### 📦 Manuel Deployment (SSH)
```bash
./deploy.sh
```
Bu script:
1. ✅ SSH ile sunucuya bağlanır
2. ✅ Gitea'dan son kodu çeker
3. ✅ Backend dependencies yükler
4. ✅ Database migration yapar
5. ✅ Frontend build eder
6. ✅ Servisleri restart eder
7. ✅ Health check yapar
### Manuel Deployment
```bash
# SSH ile sunucuya bağlan
ssh root@176.96.129.77
# Proje dizinine git
cd /opt/hosting-platform
# Git pull
git pull origin main
# Backend güncelle
cd backend
source venv/bin/activate
pip install -r requirements.txt
python -c "from app.main import app, db; app.app_context().push(); db.create_all()"
# Frontend build
cd ../frontend
npm install
npm run build
# Servisleri restart et
supervisorctl restart hosting-backend hosting-frontend
```
### Servis Yönetimi
```bash
# Servis durumu
supervisorctl status
# Logları izle
tail -f /var/log/hosting-backend.log
# Servisleri restart et
supervisorctl restart hosting-backend hosting-frontend
```
© 2026 ARGE ICT. All rights reserved.