REST API for Tanzania tourism — GPS-accurate attractions, real-time weather, and open data for developers.
Live API: https://cf89615f228bb45cc805447510de80.pythonanywhere.com/ | Frontend UI: https://xenohuru.netlify.app/ | Sponsor Us: Ko-fi
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.
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
- Python 3.10+, pip, virtualenv
- MySQL (or SQLite for dev)
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 runserverAPI runs at: http://localhost:8000/api/ | Admin: http://localhost:8000/admin/
| 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)
python src/manage.py test src/ # Run all tests
python src/manage.py test src/app/attractions # Run specific app- Framework: Django 4.2+ with Django REST Framework
- Database: MySQL
- Auth: JWT (djangorestframework-simplejwt)
- Weather: Open-Meteo API
- Docs: drf-spectacular (OpenAPI/Swagger)
- RESTful design with predictable endpoints
- Comprehensive OpenAPI documentation
- JWT authentication support
- Fast response times with database optimization
- Pagination & filtering support
- Free & open-source
- Well-tested codebase (pytest)
- Clear code structure & documentation
- Easy to extend with Django apps
- Docker support (coming soon)
- CI/CD with GitHub Actions
We welcome contributors! Fork the repo, create a branch, and submit a PR.
Steps:
- Fork the repository
- Create feature branch:
git checkout -b feature/your-feature - Make changes & test
- Commit:
git commit -m "Add feature" - Push & open PR
Read: CONTRIBUTING.md | CODE_OF_CONDUCT.md
MIT License — see LICENSE
🌍 Built with Django | 🇹🇿 From Tanzania | ❤️ Support us on Ko-fi