- Create organized directory structure (src/, docs/, data/, static/, templates/) - Add comprehensive .gitignore for Python projects - Move Python source files to src/ - Move documentation files to docs/ with project/ and user/ subdirectories - Move database files to data/ - Update all database path references in Python code - Maintain Flask static/ and templates/ directories 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
348 lines
7.4 KiB
Markdown
348 lines
7.4 KiB
Markdown
# 🛠️ GHID DE INSTALARE - INDEX-SISTEM-JOCURI
|
|
|
|
**Instrucțiuni complete pentru instalarea și configurarea sistemului**
|
|
|
|
---
|
|
|
|
## 📋 CERINȚE PREALABILE
|
|
|
|
### Sistem de operare
|
|
- ✅ **Windows** 10/11
|
|
- ✅ **macOS** 10.15+
|
|
- ✅ **Linux** (Ubuntu, Debian, CentOS, etc.)
|
|
|
|
### Software necesar
|
|
- **Python 3.8+** - [Descărcați aici](https://python.org/downloads)
|
|
- **pip** - Instalat automat cu Python
|
|
- **Browser modern** - Chrome, Firefox, Safari, Edge
|
|
|
|
---
|
|
|
|
## 🚀 INSTALARE RAPIDĂ
|
|
|
|
### Pasul 1: Verificați Python
|
|
```bash
|
|
# Verificați versiunea Python
|
|
python --version
|
|
# sau
|
|
python3 --version
|
|
|
|
# Trebuie să vedeți: Python 3.8.x sau mai nou
|
|
```
|
|
|
|
### Pasul 2: Navigați la director
|
|
```bash
|
|
# Pe Windows
|
|
cd "C:\path\to\INDEX-SISTEM-JOCURI"
|
|
|
|
# Pe Mac/Linux
|
|
cd /path/to/INDEX-SISTEM-JOCURI
|
|
```
|
|
|
|
### Pasul 3: Instalați dependențele
|
|
```bash
|
|
pip install flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
```
|
|
|
|
### Pasul 4: Testați instalarea
|
|
```bash
|
|
python indexer.py --test-mode
|
|
```
|
|
|
|
### Pasul 5: Porniți aplicația
|
|
```bash
|
|
python app.py
|
|
```
|
|
|
|
### Pasul 6: Accesați interfața
|
|
Deschideți browserul la: **http://localhost:5000**
|
|
|
|
---
|
|
|
|
## 🔧 INSTALARE DETALIATĂ
|
|
|
|
### Pentru Windows
|
|
|
|
#### 1. Instalați Python
|
|
1. Descărcați Python de la https://python.org/downloads
|
|
2. Rulați installer-ul cu opțiunea "Add Python to PATH" bifată
|
|
3. Verificați instalarea în Command Prompt:
|
|
```cmd
|
|
python --version
|
|
pip --version
|
|
```
|
|
|
|
#### 2. Instalați dependențele
|
|
```cmd
|
|
# Deschideți Command Prompt ca Administrator
|
|
pip install flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
|
|
# În caz de eroare, încercați:
|
|
python -m pip install flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
```
|
|
|
|
#### 3. Configurați sistemul
|
|
```cmd
|
|
# Navigați la directorul sistemului
|
|
cd "D:\GoogleDrive\Cercetasi\carti-camp-jocuri\INDEX-SISTEM-JOCURI"
|
|
|
|
# Testați indexer-ul
|
|
python indexer.py --test-mode --max-files 3
|
|
```
|
|
|
|
### Pentru macOS
|
|
|
|
#### 1. Instalați Python (dacă nu este instalat)
|
|
```bash
|
|
# Folosind Homebrew (recomandat)
|
|
brew install python
|
|
|
|
# Sau descărcați de la python.org
|
|
```
|
|
|
|
#### 2. Instalați dependențele
|
|
```bash
|
|
pip3 install flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
|
|
# În caz de probleme cu permisiuni:
|
|
pip3 install --user flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
```
|
|
|
|
#### 3. Configurați sistemul
|
|
```bash
|
|
# Navigați la directorul sistemului
|
|
cd "/Users/username/GoogleDrive/Cercetasi/carti-camp-jocuri/INDEX-SISTEM-JOCURI"
|
|
|
|
# Testați indexer-ul
|
|
python3 indexer.py --test-mode
|
|
```
|
|
|
|
### Pentru Linux (Ubuntu/Debian)
|
|
|
|
#### 1. Instalați Python și pip
|
|
```bash
|
|
sudo apt update
|
|
sudo apt install python3 python3-pip python3-venv
|
|
|
|
# Verificați instalarea
|
|
python3 --version
|
|
pip3 --version
|
|
```
|
|
|
|
#### 2. Instalați dependențele sistem
|
|
```bash
|
|
# Pentru procesarea PDF-urilor
|
|
sudo apt install python3-dev
|
|
|
|
# Instalați pachetele Python
|
|
pip3 install flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
```
|
|
|
|
#### 3. Configurați sistemul
|
|
```bash
|
|
# Navigați la directorul sistemului
|
|
cd "/home/username/GoogleDrive/Cercetasi/carti-camp-jocuri/INDEX-SISTEM-JOCURI"
|
|
|
|
# Dați permisiuni de execuție
|
|
chmod +x indexer.py app.py
|
|
|
|
# Testați sistemul
|
|
python3 indexer.py --test-mode
|
|
```
|
|
|
|
---
|
|
|
|
## 🗃️ CONFIGURARE INIȚIALĂ
|
|
|
|
### 1. Indexarea primelor fișiere
|
|
|
|
#### Indexare test (5 fișiere)
|
|
```bash
|
|
python indexer.py --test-mode --clear-db
|
|
```
|
|
|
|
#### Indexare completă (toate fișierele)
|
|
```bash
|
|
python indexer.py --clear-db
|
|
```
|
|
|
|
**⚠️ Atenție:** Indexarea completă poate dura 10-30 minute pentru 100+ fișiere
|
|
|
|
### 2. Verificarea rezultatelor
|
|
```bash
|
|
# Verificați numărul de activități indexate
|
|
python -c "
|
|
from database import DatabaseManager
|
|
db = DatabaseManager('activities.db')
|
|
stats = db.get_statistics()
|
|
print(f'Total activități: {stats[\"total_activities\"]}')
|
|
print(f'Categorii: {list(stats[\"categories\"].keys())}')
|
|
"
|
|
```
|
|
|
|
### 3. Pornirea serviciului web
|
|
```bash
|
|
python app.py
|
|
```
|
|
|
|
---
|
|
|
|
## 🐛 REZOLVAREA PROBLEMELOR DE INSTALARE
|
|
|
|
### Erori comune și soluții
|
|
|
|
#### "Python is not recognized"
|
|
**Windows:**
|
|
```cmd
|
|
# Reinstalați Python cu "Add to PATH" bifat
|
|
# Sau adaugați manual la PATH:
|
|
set PATH=%PATH%;C:\Python39;C:\Python39\Scripts
|
|
```
|
|
|
|
#### "Permission denied" pe pip install
|
|
**Mac/Linux:**
|
|
```bash
|
|
# Folosiți --user flag
|
|
pip3 install --user flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
|
|
# Sau creați un virtual environment
|
|
python3 -m venv myenv
|
|
source myenv/bin/activate # Mac/Linux
|
|
# myenv\Scripts\activate # Windows
|
|
pip install flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
```
|
|
|
|
#### "No module named 'flask'"
|
|
```bash
|
|
# Verificați că sunteți în mediul corect
|
|
which python
|
|
which pip
|
|
|
|
# Reinstalați explicit
|
|
pip install --upgrade flask
|
|
```
|
|
|
|
#### Erori la procesarea PDF-urilor
|
|
```bash
|
|
# Instalați dependențe suplimentare
|
|
pip install pdfplumber PyPDF2 --upgrade
|
|
|
|
# Pe Linux, poate fi nevoie de:
|
|
sudo apt install python3-dev libffi-dev
|
|
```
|
|
|
|
#### "Database is locked"
|
|
```bash
|
|
# Ștergeți fișierul bazei de date și recreați
|
|
rm activities.db
|
|
python indexer.py --test-mode --clear-db
|
|
```
|
|
|
|
#### Port 5000 este ocupat
|
|
```bash
|
|
# Modificați portul în app.py, linia finală:
|
|
# app.run(port=5001) # sau orice alt port liber
|
|
```
|
|
|
|
---
|
|
|
|
## 🔐 CONFIGURARE AVANSATĂ
|
|
|
|
### Environment Variables
|
|
```bash
|
|
# Windows
|
|
set FLASK_ENV=development
|
|
set FLASK_DEBUG=1
|
|
|
|
# Mac/Linux
|
|
export FLASK_ENV=development
|
|
export FLASK_DEBUG=1
|
|
```
|
|
|
|
### Virtual Environment (Recomandat pentru dezvoltare)
|
|
```bash
|
|
# Creați environment
|
|
python -m venv venv
|
|
|
|
# Activați
|
|
source venv/bin/activate # Mac/Linux
|
|
venv\Scripts\activate # Windows
|
|
|
|
# Instalați dependențele
|
|
pip install flask PyPDF2 python-docx beautifulsoup4 markdown pdfplumber
|
|
|
|
# Dezactivați când terminați
|
|
deactivate
|
|
```
|
|
|
|
### Configurare pentru producție
|
|
```python
|
|
# În app.py, pentru producție schimbați:
|
|
app.run(
|
|
host='127.0.0.1', # doar localhost
|
|
port=5000,
|
|
debug=False, # dezactivați debug
|
|
threaded=True
|
|
)
|
|
```
|
|
|
|
---
|
|
|
|
## ✅ VERIFICAREA INSTALĂRII
|
|
|
|
### Checklist final
|
|
- [ ] Python 3.8+ instalat și funcțional
|
|
- [ ] Toate dependențele pip instalate fără erori
|
|
- [ ] `python indexer.py --test-mode` rulează cu succes
|
|
- [ ] `python app.py` pornește fără erori
|
|
- [ ] http://localhost:5000 se încarcă în browser
|
|
- [ ] Interfața afișează statistici (numărul de activități)
|
|
- [ ] Căutarea funcționează (există cel puțin 1 rezultat)
|
|
- [ ] Generarea fișelor funcționează
|
|
|
|
### Test complet
|
|
```bash
|
|
# 1. Test indexer
|
|
python indexer.py --test-mode --clear-db
|
|
|
|
# 2. Test statistici
|
|
python -c "
|
|
from database import DatabaseManager
|
|
db = DatabaseManager('activities.db')
|
|
print('Stats:', db.get_statistics())
|
|
"
|
|
|
|
# 3. Test server (într-un terminal separat)
|
|
python app.py
|
|
|
|
# 4. Test API (într-un alt terminal)
|
|
curl http://localhost:5000/api/statistics
|
|
```
|
|
|
|
---
|
|
|
|
## 🆘 SUPORT INSTALARE
|
|
|
|
### În caz de probleme:
|
|
|
|
1. **Verificați versiunea Python:** `python --version`
|
|
2. **Verificați permisiunile:** Rulați ca administrator/root dacă e necesar
|
|
3. **Verificați spațiul pe disk:** Minim 100MB liber
|
|
4. **Verificați conexiunea internet:** Pentru descărcarea dependențelor
|
|
|
|
### Informații pentru suport:
|
|
```bash
|
|
# Colectați informații sistem pentru suport
|
|
python -c "
|
|
import sys
|
|
import platform
|
|
print('Python:', sys.version)
|
|
print('Platform:', platform.platform())
|
|
print('Architecture:', platform.architecture())
|
|
"
|
|
```
|
|
|
|
---
|
|
|
|
**🎮 INDEX-SISTEM-JOCURI v1.0**
|
|
*Ghid de instalare - Actualizat Septembrie 2025* |