AfriDataHubBackend / README.md
rinogeek's picture
Update
0ae742f
metadata
title: AfriDataHub Backend
emoji: πŸš€
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
pinned: false

AfriDataHub Backend API

Welcome to the backend repository for AfriDataHub, a platform dedicated to aggregating, analyzing, and visualizing African data.

πŸ›  Technology Stack

  • Framework: Django & Django REST Framework
  • Database: SQLite (Development) / PostgreSQL (Production ready)
  • AI Integration: Google Gemini API for predictive analytics
  • Data Processing: Pandas, NumPy
  • Task Queue: Celery & Redis

πŸš€ Deployment

This application is containerized using Docker and is designed to run on Hugging Face Spaces.

Environment Variables

Ensure the following secrets/variables are set in your Hugging Face Space:

  • SECRET_KEY: Django secret key.
  • DEBUG: Set to False in production.
  • GEMINI_API_KEY: API Key for Google Gemini.
  • CELERY_BROKER_URL: URL for Redis (if using Celery).

πŸ“‘ API Endpoints

The API serves as the central nervous system for the platform, providing endpoints for:

  • /api/auth/: User authentication and profile management.
  • /api/datasets/: Access to public datasets.
  • /api/analytics/: AI-powered analytics and dashboard data.
  • /api/alerts/: System notifications and data anomalies.

πŸ“¦ Run Locally

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

# Option A (quick dev): SQLite
# export DATABASE_URL=sqlite:///db.sqlite3

# Option B: PostgreSQL via DB_* env vars (see INSTALL.md / docker-compose.yml)

python manage.py migrate
python manage.py runserver