Logo Lanfrica

shabanihamidu19-cell/DarEvent

Domaine:

digital infrastructure

Type de record:

software
Créateur:
sha
Hôte:
DarEvents — Automated events discovery for Dar es Salaam & Tanzania. Self-managing (Tavily + Grok), sponsored first, likes/trending, free event posting. # DarEvents — Automated Events Platform (Tanzania) **Jukwaa la matukio linalojisimamia** — data inakusanywa otomatiki kwa Tavily + AI. ## Features - ✅ **Automated collection** (Tavily + AI structured extraction) - ✅ **Sponsored / Ads always first** - ✅ **Anyone can post an event** (“Weka Tukio”) — free for now + duration selector (demo $1 / 2 days) - ✅ Self-managing: dedup, expire old, max 300 - ✅ Polished Swahili frontend (stronger than local competitors) - ✅ M-Pesa ready UI, filters, map, digest - ✅ Ready for cron / Docker / any VPS ## Project Structure ``` darevents/ ├── backend/ │ ├── main.py # FastAPI app │ ├── collector.py # Tavily + AI collector │ ├── config.py │ ├── models.py │ └── requirements.txt ├── frontend/ │ └── index.html # Dynamic UI (fetches /api/events) ├── data/ │ ├── events.json # Live events (auto-updated) │ └── sponsored.json ├── scripts/ │ └── run_collector.sh ├── .env.example └── README.md ``` ## Quick Start (Local) ```bash cd darevents/backend python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt # Seed demo data (works without keys) python collector.py seed # Run API + frontend uvicorn main:app --reload --host 0.0.0.0 --port 8000 ``` Open localhost ## Production (Server) 1. Copy `.env.example` → `.env` and put your real keys: ``` TAVILY_API_KEY=tvly-... OPENAI_API_KEY=... # or xAI key AI_BASE_URL=api.x.ai # if using Grok AI_MODEL=grok-beta ``` 2. Install & run: ```bash pip install -r backend/requirements.txt cd backend python collector.py seed # first time uvicorn main:app --host 0.0.0.0 --port 8000 ``` 3. **Auto-collect every 6 hours** (cron example): ```cron 0 */6 * * * cd /path/to/darevents/backend && /path/to/venv/bin/python collector.py >> /var/log/darevents-collect.log 2>&1 ``` Or enable APScheduler inside `main.py` (uncomment the scheduler block). 4. Trigger manually: ```bash …