166 lines
3.4 KiB
Markdown
166 lines
3.4 KiB
Markdown
# 📚 Ebook Translation System
|
|
|
|
Enterprise-grade systém na správu prekladov e-kníh s kupónovým systémom.
|
|
|
|
## 🎯 Komponenty
|
|
|
|
- **Backend API** (FastAPI) - REST API server
|
|
- **Admin Dashboard** - Webové rozhranie pre správu
|
|
- **PostgreSQL** - Databáza
|
|
- **Chrome Extension** - Automatická aplikácia prekladov
|
|
|
|
## 🚀 Quick Start
|
|
|
|
### Lokálne (Docker)
|
|
|
|
```bash
|
|
# 1. Vytvorte .env
|
|
cp .env.production .env
|
|
nano .env # Upravte heslá
|
|
|
|
# 2. Spustite
|
|
./docker-start.sh
|
|
# ALEBO
|
|
docker-compose up -d --build
|
|
|
|
# 3. Otvorte
|
|
http://localhost:8000/login
|
|
```
|
|
|
|
### Production (Coolify)
|
|
|
|
Detailný návod: [GITEA_COOLIFY_SETUP.md](GITEA_COOLIFY_SETUP.md)
|
|
|
|
```bash
|
|
# 1. Push do Git
|
|
git init
|
|
git add .
|
|
git commit -m "Initial commit"
|
|
git push origin main
|
|
|
|
# 2. V Coolify
|
|
- New Resource → Docker Compose
|
|
- Pripojte Git repo
|
|
- Nastavte Environment Variables
|
|
- Deploy!
|
|
```
|
|
|
|
## 📖 Dokumentácia
|
|
|
|
- **[GITEA_COOLIFY_SETUP.md](GITEA_COOLIFY_SETUP.md)** - Gitea + Coolify deployment
|
|
- **[COOLIFY_DEPLOYMENT.md](COOLIFY_DEPLOYMENT.md)** - Coolify detaily
|
|
- **[DOCKER_README.md](DOCKER_README.md)** - Docker usage guide
|
|
- **[NAVOD_SLOVENSKY.md](NAVOD_SLOVENSKY.md)** - Slovenský kompletný návod
|
|
- **[SYSTEM_DOCUMENTATION.md](SYSTEM_DOCUMENTATION.md)** - Technická dokumentácia
|
|
|
|
## 🔧 Tech Stack
|
|
|
|
- **Backend:** FastAPI, Python 3.11+
|
|
- **Database:** PostgreSQL 15
|
|
- **Frontend:** HTML5, CSS3, Vanilla JS
|
|
- **Extension:** Chrome Extension (Manifest V3)
|
|
- **Deployment:** Docker, Docker Compose, Coolify
|
|
|
|
## 📝 Environment Variables
|
|
|
|
```bash
|
|
# Database
|
|
POSTGRES_DB=ebook_prod
|
|
POSTGRES_USER=ebook_user
|
|
POSTGRES_PASSWORD=changeme
|
|
|
|
# Security
|
|
SECRET_KEY=generate-new-32-chars
|
|
DEBUG=false
|
|
ENVIRONMENT=production
|
|
|
|
# Admin
|
|
ADMIN_USERNAME=admin
|
|
ADMIN_PASSWORD=changeme
|
|
|
|
# CORS
|
|
CORS_ORIGINS=https://your-domain.com
|
|
```
|
|
|
|
**Vygenerovať SECRET_KEY:**
|
|
```bash
|
|
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
|
|
```
|
|
|
|
## 🎮 Usage
|
|
|
|
### Admin Panel
|
|
|
|
1. Login: `https://your-domain.com/login`
|
|
2. Generate kupóny
|
|
3. Upload translation Excel súbor
|
|
4. Manage kupóny
|
|
|
|
### Chrome Extension
|
|
|
|
1. Načítať extension do Chrome
|
|
2. Upraviť `config.js` → `API_BASE`
|
|
3. Zadať kupón
|
|
4. Vybrať jazyk
|
|
5. Spustiť preklad
|
|
|
|
## 🔐 Security
|
|
|
|
- ✅ Bcrypt password hashing
|
|
- ✅ Session-based authentication
|
|
- ✅ CORS protection
|
|
- ✅ SQL injection prevention
|
|
- ✅ HTTPS/SSL (production)
|
|
- ✅ Environment-based secrets
|
|
|
|
## 🐛 Troubleshooting
|
|
|
|
### Health Check
|
|
```bash
|
|
curl https://your-domain.com/health
|
|
```
|
|
|
|
### Logs
|
|
```bash
|
|
docker-compose logs -f backend
|
|
```
|
|
|
|
### Database
|
|
```bash
|
|
docker-compose exec postgres psql -U ebook_user -d ebook_prod
|
|
```
|
|
|
|
## 📊 API Endpoints
|
|
|
|
- `GET /health` - Health check
|
|
- `POST /admin/login` - Admin login
|
|
- `POST /generate` - Generate coupons
|
|
- `GET /list` - List coupons
|
|
- `POST /verify` - Verify coupon
|
|
- `POST /upload-translations` - Upload translation file
|
|
- `GET /translations/latest` - Download translations
|
|
|
|
**Full API Docs:** `https://your-domain.com/docs`
|
|
|
|
## 🤝 Contributing
|
|
|
|
1. Fork the repo
|
|
2. Create feature branch (`git checkout -b feature/amazing`)
|
|
3. Commit changes (`git commit -m 'Add amazing feature'`)
|
|
4. Push to branch (`git push origin feature/amazing`)
|
|
5. Open Pull Request
|
|
|
|
## 📄 License
|
|
|
|
MIT License - see LICENSE file for details
|
|
|
|
## 📞 Support
|
|
|
|
- **Documentation:** See `/docs` folder
|
|
- **Issues:** GitHub Issues
|
|
- **Health Check:** `/health` endpoint
|
|
|
|
---
|
|
|
|
**Built with ❤️ using FastAPI, Docker, and modern web technologies**
|