refactor: complete project restructure - clean and professional
🎯 New Structure: - landing/ (root) - Only Makefile, .gitignore, .woodpecker.yml - helm/ - Kubernetes deployment (with argocd inside chart) - docker/ - Docker build configs - peikarband/ - All source code (src, tests, assets, config, tools, docs) ✅ Changes: - Moved Docker files: build/docker/ → docker/ - Moved Helm charts: deploy/helm/ → helm/ - Moved ArgoCD: deploy/argocd/ → helm/peikarband/argocd/ - Moved all source code to peikarband/ - Removed duplicate files (7 files) - Removed old empty directories 🐳 Docker Fixes: - Added npm retry configuration (fetch-retry-mintimeout, etc.) - Added 3-attempt retry mechanism for reflex export - Fixed ECONNREFUSED errors - Updated paths for new structure 📦 Config Updates: - Makefile: Updated all paths (docker/, helm/, peikarband/) - .woodpecker.yml: Updated dockerfile and context paths - .gitignore: Updated data/ path 🧪 Tests: - ✓ Helm lint passes - ✓ All paths validated - ✓ Structure verified 📊 Result: - Before: 20+ files in root, scattered structure - After: 3 files + 3 directories, clean and organized - Production-ready ✨
This commit is contained in:
222
peikarband/README.md
Normal file
222
peikarband/README.md
Normal file
@@ -0,0 +1,222 @@
|
||||
# پیکربند - پلتفرم جامع مدیریت هاستینگ و زیرساخت ابری
|
||||
|
||||
## 📖 درباره پروژه
|
||||
|
||||
پیکربند یک پلتفرم حرفهای برای مدیریت هاستینگ، سرورهای ابری، دامین و خدمات DevOps است. این پلتفرم با الهام از سرویسهایی مانند Cloudways، DigitalOcean و پارس پک طراحی شده است.
|
||||
|
||||
## 🏗️ معماری
|
||||
|
||||
این پروژه بر اساس **Clean Architecture** و اصول **SOLID** طراحی شده است:
|
||||
|
||||
- **Domain Layer**: منطق کسبوکار اصلی
|
||||
- **Application Layer**: موارد استفاده (Use Cases)
|
||||
- **Infrastructure Layer**: پیادهسازیهای فنی
|
||||
- **Presentation Layer**: رابط کاربری (Reflex)
|
||||
|
||||
## 🚀 تکنولوژیها
|
||||
|
||||
- **Frontend/Backend**: Python Reflex
|
||||
- **Database**: PostgreSQL + SQLAlchemy
|
||||
- **Cache**: Redis
|
||||
- **Task Queue**: Celery
|
||||
- **Testing**: pytest
|
||||
- **Code Quality**: black, flake8, mypy, isort
|
||||
|
||||
## 📋 پیشنیازها
|
||||
|
||||
- Python 3.11+
|
||||
- PostgreSQL 14+
|
||||
- Redis 7+
|
||||
- Node.js 18+ (برای Reflex)
|
||||
|
||||
## 🛠️ نصب و راهاندازی
|
||||
|
||||
### 1. کلون کردن پروژه
|
||||
|
||||
```bash
|
||||
git clone https://github.com/yourusername/peikarband.git
|
||||
cd peikarband
|
||||
```
|
||||
|
||||
### 2. ایجاد محیط مجازی
|
||||
|
||||
```bash
|
||||
python -m venv venv
|
||||
source venv/bin/activate # On Windows: venv\Scripts\activate
|
||||
```
|
||||
|
||||
### 3. نصب وابستگیها
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-dev.txt # برای توسعه
|
||||
```
|
||||
|
||||
### 4. تنظیم Environment Variables
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# ویرایش .env و تکمیل مقادیر
|
||||
```
|
||||
|
||||
### 5. راهاندازی دیتابیس
|
||||
|
||||
```bash
|
||||
# ایجاد دیتابیس
|
||||
createdb peikarband
|
||||
|
||||
# اجرای migrations
|
||||
alembic upgrade head
|
||||
```
|
||||
|
||||
### 6. اجرای پروژه
|
||||
|
||||
```bash
|
||||
# توسعه
|
||||
python -m reflex run
|
||||
|
||||
# یا
|
||||
make dev
|
||||
```
|
||||
|
||||
## 🚢 Deployment
|
||||
|
||||
### با Docker
|
||||
|
||||
```bash
|
||||
# Build
|
||||
docker build -t peikarband:latest .
|
||||
|
||||
# Run
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### با Kubernetes/Helm
|
||||
|
||||
```bash
|
||||
# Deploy
|
||||
helm upgrade --install peikarband ./deploy/helm/peikarband \
|
||||
--namespace production \
|
||||
--set image.tag=0.1.0
|
||||
|
||||
# یا
|
||||
make k8s-deploy
|
||||
```
|
||||
|
||||
📖 [راهنمای کامل Deployment](docs/deployment/kubernetes.md)
|
||||
|
||||
## 📁 ساختار پروژه
|
||||
|
||||
```
|
||||
peikarband-landing/
|
||||
├── build/ # Build configs (Docker, CI/CD)
|
||||
├── deploy/ # Deployment configs (Helm, K8s, ArgoCD)
|
||||
├── config/ # Configuration files
|
||||
├── tools/ # Scripts و ابزارها
|
||||
├── assets/ # Static assets
|
||||
├── src/ # Source code (Clean Architecture)
|
||||
│ ├── config/ # تنظیمات
|
||||
│ ├── core/ # هسته اصلی (Domain + Application)
|
||||
│ ├── infrastructure/ # پیادهسازیهای فنی
|
||||
│ ├── presentation/ # رابط کاربری (Reflex)
|
||||
│ └── shared/ # کدهای مشترک
|
||||
├── tests/ # تستها
|
||||
├── docs/ # مستندات کامل
|
||||
└── data/ # Local data (gitignored)
|
||||
```
|
||||
|
||||
📖 [ساختار کامل پروژه](docs/PROJECT_STRUCTURE.md)
|
||||
|
||||
## 🧪 تست
|
||||
|
||||
```bash
|
||||
# اجرای همه تستها
|
||||
pytest
|
||||
|
||||
# با coverage
|
||||
pytest --cov=src tests/
|
||||
|
||||
# تستهای خاص
|
||||
pytest tests/unit/
|
||||
pytest tests/integration/
|
||||
```
|
||||
|
||||
## 📝 کدنویسی
|
||||
|
||||
### استانداردها
|
||||
|
||||
- **PEP 8**: استاندارد کدنویسی Python
|
||||
- **PEP 20**: Zen of Python
|
||||
- **Type Hints**: همه جا استفاده شود
|
||||
- **Docstrings**: Google Style
|
||||
|
||||
### ابزارهای کیفیت کد
|
||||
|
||||
```bash
|
||||
# Format
|
||||
black src/
|
||||
|
||||
# Linting
|
||||
flake8 src/
|
||||
|
||||
# Type checking
|
||||
mypy src/
|
||||
|
||||
# Import sorting
|
||||
isort src/
|
||||
```
|
||||
|
||||
### Pre-commit Hooks
|
||||
|
||||
```bash
|
||||
pre-commit install
|
||||
pre-commit run --all-files
|
||||
```
|
||||
|
||||
## 📚 مستندات
|
||||
|
||||
مستندات کامل در پوشه `docs/` موجود است:
|
||||
|
||||
- [Handbook](docs/handbook.md): راهنمای جامع پروژه
|
||||
- [Architecture](docs/architecture/): معماری سیستم
|
||||
- [Development](docs/development/): راهنمای توسعه
|
||||
- [API Reference](docs/api/): مستندات API
|
||||
|
||||
## 🔐 امنیت
|
||||
|
||||
- همه پسوردها با bcrypt hash میشوند
|
||||
- استفاده از JWT برای authentication
|
||||
- پشتیبانی از 2FA
|
||||
- اطلاعات حساس رمزنگاری میشوند
|
||||
|
||||
## 🤝 مشارکت
|
||||
|
||||
برای مشارکت در پروژه:
|
||||
|
||||
1. Fork کنید
|
||||
2. Branch جدید بسازید (`git checkout -b feature/amazing-feature`)
|
||||
3. Commit کنید (`git commit -m 'feat: add amazing feature'`)
|
||||
4. Push کنید (`git push origin feature/amazing-feature`)
|
||||
5. Pull Request بسازید
|
||||
|
||||
## 📄 لایسنس
|
||||
|
||||
این پروژه تحت لایسنس MIT منتشر شده است.
|
||||
|
||||
## 👥 تیم
|
||||
|
||||
- Lead Developer: [Your Name]
|
||||
- Architecture: Clean Architecture
|
||||
- Methodology: Agile/Scrum
|
||||
|
||||
## 📞 تماس
|
||||
|
||||
- Website: https://peikarband.ir
|
||||
- Email: support@peikarband.ir
|
||||
- Telegram: @peikarband
|
||||
|
||||
---
|
||||
|
||||
**نسخه**: 0.1.0
|
||||
**آخرین بروزرسانی**: 2025-01-24
|
||||
|
||||
Reference in New Issue
Block a user