Skip to content

Nootski/huisartsenai

Repository files navigation

AI Tool Catalog for Healthcare (Huisarts)

A Flask web application that displays and manages an interactive catalog of AI tools for healthcare professionals (General Practitioners / Huisartsen).

Features

  • πŸ“Š Interactive DataTable interface with search, sort, and filter capabilities
  • πŸ”„ Automatic Excel file parsing with smart header detection
  • πŸ“± Responsive design with Bootstrap
  • πŸ” Search across all fields
  • πŸ“€ Export functionality (Excel, CSV, PDF)
  • 🎨 Modern dark-themed UI
  • πŸ”„ Automatic grouping of tools with multiple modules

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Installation

1. Clone the repository

git clone https://github.com/Nootski/huisartsenai.git
cd huisartsenai

2. Create a virtual environment (recommended)

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Configure the application

Copy the example environment file and edit it:

cp .env.example .env

Edit .env to set your configuration:

  • CATALOG_FILE_PATH: Path to your Excel catalog file (optional, defaults to gp_ai_tool_catalog-2.xlsx in project root)
  • PORT: Port to run the application on (default: 5173)
  • SECRET_KEY: Set a secure secret key for production

Usage

Development Mode

python app.py

The application will be available at http://127.0.0.1:5173

Production Mode (with Gunicorn)

gunicorn --bind 0.0.0.0:5173 --workers 4 wsgi:app

Excel File Format

The application expects an Excel file with the following structure:

  • First column should contain the tool name
  • Subsequent columns can include: modules, wijze (method), functies (functions), integraties (integrations), etc.
  • Tools with multiple modules can span multiple rows (with empty name cells for subsequent rows - they will be automatically grouped)

Example:

name               | modules            | wijze        | functies
Tool Name          | Module 1           | Method 1     | Function 1
                   | Module 2           | Method 2     | Function 2
Another Tool       | Module A           | Method A     | Function A

VPS Deployment

1. Install Python and dependencies on your VPS

sudo apt update
sudo apt install python3 python3-pip python3-venv nginx

2. Copy your project to the VPS

scp -r ./* user@your-vps-ip:/var/www/ai-huisarts/

Or use Git:

ssh user@your-vps-ip
cd /var/www
git clone <your-repository-url> ai-huisarts
cd ai-huisarts

3. Set up virtual environment and install dependencies

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

4. Configure environment variables

cp .env.example .env
nano .env  # Edit configuration

5. Set up systemd service

Copy the provided service file:

sudo cp deployment/ai-huisarts.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable ai-huisarts
sudo systemctl start ai-huisarts

Check status:

sudo systemctl status ai-huisarts

6. Configure Nginx as reverse proxy

Copy the provided Nginx configuration:

sudo cp deployment/nginx.conf /etc/nginx/sites-available/ai-huisarts
sudo ln -s /etc/nginx/sites-available/ai-huisarts /etc/nginx/sites-enabled/
sudo nginx -t  # Test configuration
sudo systemctl restart nginx

7. Set up SSL (optional but recommended)

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com

Project Structure

.
β”œβ”€β”€ app.py                      # Main Flask application
β”œβ”€β”€ wsgi.py                     # WSGI entry point for production
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ gp_ai_tool_catalog-2.xlsx  # Excel catalog file
β”œβ”€β”€ templates/
β”‚   └── index.html             # Main HTML template
β”œβ”€β”€ static/
β”‚   └── vendor/                # JavaScript and CSS libraries
β”‚       β”œβ”€β”€ bootstrap.min.css
β”‚       β”œβ”€β”€ bootstrap.bundle.min.js
β”‚       β”œβ”€β”€ datatables.min.css
β”‚       β”œβ”€β”€ datatables.min.js
β”‚       β”œβ”€β”€ jquery-3.7.1.min.js
β”‚       └── jszip.min.js
β”œβ”€β”€ deployment/
β”‚   β”œβ”€β”€ ai-huisarts.service   # Systemd service file
β”‚   └── nginx.conf             # Nginx configuration
└── README.md                  # This file

API Endpoints

  • GET / - Main application interface
  • GET /api/data - JSON API endpoint returning catalog data

Development

Code Structure

The application uses:

  • Flask for the web framework
  • Pandas for Excel file processing
  • DataTables for the interactive table interface
  • Bootstrap for responsive design

Key Features

  1. Smart Excel Parsing: Automatically detects header rows and handles various Excel formats
  2. Tool Grouping: Automatically groups multiple rows of the same tool (for tools with multiple modules)
  3. Caching: File modification time-based caching for better performance
  4. Error Handling: Graceful handling of missing or malformed Excel files

Troubleshooting

Port already in use

If port 5173 is already in use, you can change it via environment variable:

export PORT=8080
python app.py

Excel file not found

Ensure the CATALOG_FILE_PATH in your .env file points to the correct location, or place the Excel file in the project root directory.

Permission denied on VPS

Make sure your application has read permissions for the Excel file:

chmod 644 gp_ai_tool_catalog-2.xlsx

License

[Your License Here]

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues and questions, please open an issue on the GitHub repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors