Skip to content

xenohuru/xenohuru-api

Repository files navigation

🌍 Xenohuru API

REST API for Tanzania tourism — GPS-accurate attractions, real-time weather, and open data for developers.

License: MIT Django Python PRs Welcome Open Source Community

Live API: https://cf89615f228bb45cc805447510de80.pythonanywhere.com/ | Frontend UI: https://xenohuru.netlify.app/ | Sponsor Us: Ko-fi


About

Open-source Tanzania tourism API by Xenohuru — From Greek "xenos" (explorer) + Swahili "huru" (free).

This backend provides GPS-accurate attraction data, real-time weather, and REST API for developers building tourism experiences.


Architecture

xenohuru-api/
├── src/
│   ├── app/
│   │   ├── accounts/     # User authentication & JWT
│   │   ├── attractions/  # Attractions API
│   │   ├── regions/      # Regions API
│   │   └── weather/      # Weather integration
│   ├── config/           # Django settings
│   └── manage.py
├── requirements.txt
└── docs/

Features:

  • REST API with Django REST Framework
  • JWT authentication
  • Real-time weather (Open-Meteo)
  • GPS-accurate locations
  • OpenAPI documentation

Quick Start

Prerequisites

  • Python 3.10+, pip, virtualenv
  • MySQL (or SQLite for dev)

Installation

git clone https://github.com/Xenohuru/xenohuru-api.git
cd xenohuru-api
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env  # Edit with your config
python src/manage.py migrate
python src/manage.py runserver

API runs at: http://localhost:8000/api/ | Admin: http://localhost:8000/admin/


API Endpoints

Endpoint Method Description
/attractions/ GET List attractions
/attractions/:slug/ GET Attraction details
/regions/ GET List regions
/weather/ GET Current weather (by coordinates or attraction)
/auth/login/ POST User authentication
/auth/register/ POST User registration

Full docs: https://cf89615f228bb45cc805447510de80.pythonanywhere.com/ (Swagger)


Testing

python src/manage.py test src/  # Run all tests
python src/manage.py test src/app/attractions  # Run specific app

Tech Stack

  • Framework: Django 4.2+ with Django REST Framework
  • Database: MySQL
  • Auth: JWT (djangorestframework-simplejwt)
  • Weather: Open-Meteo API
  • Docs: drf-spectacular (OpenAPI/Swagger)

Key Features

For API Consumers:

  • RESTful design with predictable endpoints
  • Comprehensive OpenAPI documentation
  • JWT authentication support
  • Fast response times with database optimization
  • Pagination & filtering support
  • Free & open-source

For Developers:

  • Well-tested codebase (pytest)
  • Clear code structure & documentation
  • Easy to extend with Django apps
  • Docker support (coming soon)
  • CI/CD with GitHub Actions

Contributing

We welcome contributors! Fork the repo, create a branch, and submit a PR.

Steps:

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/your-feature
  3. Make changes & test
  4. Commit: git commit -m "Add feature"
  5. Push & open PR

Read: CONTRIBUTING.md | CODE_OF_CONDUCT.md


License

MIT License — see LICENSE


🌍 Built with Django | 🇹🇿 From Tanzania | ❤️ Support us on Ko-fi