auto-reporting / web-app /README.md
MATIAS Nicolas
hf version
52f789b
|
Raw
History Blame Contribute Delete
3.69 kB
# 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`)