# šŸ› ļø 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*