Spaces:
Sleeping
Sleeping
| # ITU-T Report Generator - Web Interface | |
| Web application to generate ITU-T Working Party and Question reports from a user-friendly interface. | |
| ## Overview | |
| This web app provides a frontend for the automated report generation system. Users fill a form instead of manually editing JSON configuration files. | |
| ## Installation | |
| 1. **Activate the virtual environment** (from project root): | |
| ```bash | |
| # Windows | |
| venv\Scripts\activate | |
| # Linux/Mac | |
| source venv/bin/activate | |
| ``` | |
| 2. **Install dependencies**: | |
| ```bash | |
| cd auto-doc-latex/web-app | |
| pip install -r requirements.txt | |
| ``` | |
| 3. **Run the application**: | |
| ```bash | |
| python app.py | |
| ``` | |
| 4. **Open in browser**: | |
| ``` | |
| http://localhost:5000 | |
| ``` | |
| ## Usage | |
| 1. Select report type (Working Party or Question) | |
| 2. Fill in the form fields | |
| 3. Click "Generate Report" | |
| 4. Download the ZIP file | |
| 5. Upload to Overleaf and compile | |
| ## Project Structure | |
| ``` | |
| web-app/ | |
| βββ app.py # Flask application entry point | |
| βββ config.py # Configuration (paths, timeouts, etc.) | |
| βββ requirements.txt # Python dependencies | |
| β | |
| βββ utils/ # Backend logic | |
| β βββ file_handler.py # File operations (ZIP, temp directories) | |
| β βββ report_generator.py # Wrapper for existing scripts | |
| β βββ validators.py # Input validation | |
| β | |
| βββ templates/ # HTML templates (Jinja2) | |
| β βββ base.html # Base template | |
| β βββ index.html # Main form page | |
| β | |
| βββ static/ # Static assets | |
| β βββ css/style.css # Custom styles | |
| β βββ js/app.js # Frontend logic | |
| β | |
| βββ temp/ # Generated files (auto-cleaned) | |
| ``` | |
| ## Configuration Values | |
| The following values in `config.py` are **arbitrary choices** and can be adjusted based on real-world usage: | |
| | Parameter | Value | Rationale | | |
| |-----------|-------|-----------| | |
| | `MAX_CONTENT_LENGTH` | 16 MB | Arbitrary limit for CSV work programme uploads. Adjust if larger files are needed. | | |
| | `TEMP_FILE_MAX_AGE` | 1 hour | Arbitrary cleanup interval. Files older than 1 hour are deleted automatically. | | |
| | `GENERATION_TIMEOUT` | 5 minutes | Arbitrary timeout for report generation. Adjust if generation takes longer. | | |
| **Note**: These values should be monitored in production and adjusted based on: | |
| - Actual CSV file sizes encountered | |
| - Typical report generation times | |
| - Available disk space for temporary files | |
| ## Output | |
| The application generates a ZIP file containing: | |
| ``` | |
| wp_doc_template/ # or question_doc_template/ | |
| βββ main.tex # Main LaTeX document | |
| βββ chapters/ | |
| β βββ results/ # Auto-generated content from ITU data | |
| βββ styles/ # LaTeX styles | |
| βββ images/ # Images | |
| ``` | |
| This ZIP can be directly uploaded to [Overleaf](https://www.overleaf.com) for PDF compilation. | |
| ## Development | |
| - **Debug mode**: Enabled by default (see `config.py`) | |
| - **Auto-reload**: Templates reload automatically on changes | |
| - **Logging**: Check console output for errors | |
| ## Dependencies | |
| - **Flask 3.0.0**: Web framework | |
| - **beautifulsoup4 4.12.2**: HTML parsing (ITU website scraping) | |
| - **pycurl 7.45.2**: HTTP requests | |
| - **python-dateutil 2.8.2**: Date manipulation | |
| See `requirements.txt` for complete list. | |
| ## Notes | |
| - Temporary files in `temp/` are automatically cleaned after 1 hour | |
| - The app uses the existing `scripts-new/` Python scripts under the hood | |
| - Generated reports require manual sections to be filled (see main `README.md`) | |