- leadhunter_scraper.py : Google Places Nearby Search + Place Details avec compteur quota daily_quota.json (limite 900/jour), sleep(0.5) entre requêtes, fallback Overpass OSM boundary MEL, filtre website absent, déduplcation, rgpd_ok=True - leadhunter_scorer.py : moteur de scoring 0-8 pts critère n°1 = site web absent (+3), avis ≥50 (+2), note ≥4.0 (+2), téléphone (+1), note <3.0 (-1) - leadhunter_crm.py : CRM SQLite schéma validé CTO (id, source, name, address, phone, rating, reviews_count, website, score, rgpd_ok, scraped_at, status) CRUD : insert_lead, get_leads, update_lead_status, get_stats, export_csv - leadhunter_api.py : Flask service port 8769 GET /api/leads, POST /api/leads/scrape, GET /api/leads/stats, GET /api/leads/export, PATCH /api/leads/<id>/status, GET /health assert GOOGLE_PLACES_API_KEY au démarrage scraping asynchrone (thread) avec status endpoint - infra/turf-saas-leadhunter.service : service systemd EnvironmentFile=/home/h3r7/.env pour GOOGLE_PLACES_API_KEY Tests : py_compile OK, scorer testé, CRM SQLite testé Co-Authored-By: Paperclip <noreply@paperclip.ing>
22 lines
527 B
Desktop File
22 lines
527 B
Desktop File
[Unit]
|
|
Description=H3R7Tech LeadHunter API (Port 8769)
|
|
Documentation=https://portal-kolifee.duckdns.org
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=h3r7
|
|
WorkingDirectory=/home/h3r7/turf_saas
|
|
|
|
# Charger les variables d'environnement depuis /home/h3r7/.env
|
|
# (notamment GOOGLE_PLACES_API_KEY)
|
|
EnvironmentFile=/home/h3r7/.env
|
|
|
|
ExecStart=/home/h3r7/turf_saas/venv/bin/python3 /home/h3r7/turf_saas/leadhunter_api.py
|
|
Restart=always
|
|
RestartSec=10
|
|
Environment=PYTHONPATH=/home/h3r7/turf_saas
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|