Vimbai is a full-stack news aggregation and blogging app focused on Zimbabwean local news. The app scrapes multiple news sources, summarizes articles, categorizes them with AI, and generates Gen Z-style blog posts with emojis and hashtags. The frontend is built with React + Vite, and the backend uses Python, Firebase, and Gemini Flash Lite API.
- Features
- Frontend
- Backend
- Setup
- Environment Variables
- Running Locally
- GitHub Actions Automation
- Folder Structure
- License
-
Scrapes multiple Zimbabwean news sources:
- Pindula, ZimEye, New Zimbabwe, News Day, News Dze Zimbabwe
-
Summarizes articles to 2-3 sentences
-
Categorizes articles into meaningful groups using Gemini Flash Lite
-
Generates fun, Gen Z-style blogs with emojis and hashtags
-
Saves blogs and categorized articles in Firebase Firestore
-
Frontend displays blogs in cards with expandable content
-
Responsive, mobile-first UI using TailwindCSS
Tech stack: React, TypeScript, Vite, TailwindCSS, Firebase Firestore
Key components:
BlogList.tsxβ Fetches blogs from Firestore and displays them in cards. Supports βSee More/Show Lessβ toggling.StickyHeader.tsxβ Sticky top navigation.Avatar.tsxβ Loads profile picture from/publicfolder.Bio.tsxβ Displays AI author info for Vimbai.
Firebase setup:
- Firestore is used to fetch
blogs_testcollection - Vite environment variables are stored in
.envfile:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_idStart frontend locally:
cd frontend
npm install
npm run devTech stack: Python 3.11, Firebase Admin SDK, Gemini API, Sumy (text summarization), requests, BeautifulSoup
Key files:
categorizer.pyβ Scrapes news, summarizes, and categorizes articles via Gemini Flash Liteblogger.pyβ Generates Gen Z-style blog posts from categorized articles and saves to Firestoreutils/firebase.pyβ Handles Firestore operations (post_to_firestore,get_categories_for_today)scrappers/β Individual scrapers for each news sourcerequirements.txtβ Python dependencies
Install backend dependencies:
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtEnvironment Variables for backend (use GitHub secrets or .env for local dev):
GEMINI_API_KEY=your_gemini_api_key
FIREBASE_SERVICE_ACCOUNT_JSON=contents_of_your_service_account.json- Clone the repository:
git clone https://github.com/your-username/vimbai.git
cd vimbai- Install frontend dependencies:
cd frontend
npm install- Install backend dependencies:
cd ../
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Add Firebase service account JSON to
utils/firebase-service-account.jsonor as a secret in GitHub Actions. - Add Gemini API key as an environment variable or secret.
Backend:
source .venv/bin/activate
python categorizer.py # Categorize articles
python blogger.py # Generate blogsFrontend:
npm run devOpen http://localhost:5173 in your browser.
-
Workflow runs daily at 6 AM UTC to scrape, categorize, and generate blogs automatically.
-
Workflow steps:
- Checkout repository
- Set up Python 3.11
- Install dependencies
- Write Firebase service account JSON from secret
- Run
categorizer.py - Run
blogger.py
Example workflow snippet:
name: Daily Article Categorization & Blogging
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
jobs:
run_pipeline:
runs-on: ubuntu-latest
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
FIREBASE_SERVICE_ACCOUNT_JSON: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: pip install -r requirements.txt
- run: echo "$FIREBASE_SERVICE_ACCOUNT_JSON" > ./utils/firebase-service-account.json
- run: python categorizer.py
- run: python blogger.pyβββ backend
β βββ categorizer.py
β βββ blogger.py
β βββ utils
β β βββ firebase.py
β β βββ firebase-service-account.json
β βββ scrappers
β βββ pindula.py
β βββ zimeye.py
β βββ new_zimbabwe.py
β βββ news_day.py
β βββ news_dze_zimbabwe.py
βββ frontend
β βββ src
β β βββ components
β β β βββ BlogList.tsx
β β β βββ StickyHeader.tsx
β β β βββ Avatar.tsx
β β βββ App.tsx
β β βββ firebase.ts
β βββ public
β βββ avatar.png
βββ .github/workflows
β βββ daily_blog.yml
βββ README.md
βββ requirements.txt
MIT License β free to use and modify.
