|
||
---|---|---|
app | ||
scripts | ||
tests | ||
.gitignore | ||
.python-version | ||
README.md | ||
hello.py | ||
pyproject.toml |
README.md
Berlin Picnic Zone Finder API
Find the perfect picnic zones in Berlin based on your personality and preferences.
🚀 Quick Start
Prerequisites
- Python 3.11+
- uv package manager
Installation
# Clone the repository
git clone https://github.com/yourusername/berlin-picnic-api.git
cd berlin-picnic-api
# Install dependencies
uv sync --dev
# Create environment file
cp .env.example .env
# Start the development server
uv run uvicorn app.main:app --reload
The API will be available at http://localhost:8000
📚 API Documentation
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
🏗️ Project Structure
app/
├── main.py # FastAPI application
├── config.py # Configuration settings
├── models/ # Pydantic models
├── services/ # Business logic
├── utils/ # Utility functions
├── routers/ # API route handlers
└── data/ # Data storage
🔧 Development
Code Quality
# Format code
uv run ruff format .
# Lint code
uv run ruff check . --fix
# Type checking
uv run mypy app/
# Run tests
uv run pytest
# Run all checks
uv run ruff check . && uv run ruff format . && uv run mypy app/ && uv run pytest
Data Management
# Fetch Berlin open data
uv run python scripts/fetch_berlin_data.py
# Process zone data
uv run python scripts/process_zones.py
🌍 API Endpoints
Zones
GET /zones
- Get zones filtered by personality and preferencesGET /zones/{zone_id}
- Get specific zone detailsGET /zones/{zone_id}/scores
- Get personality scores for a zone
Neighborhoods
GET /neighborhoods
- Get all Berlin neighborhoods
Health
GET /health
- Basic health checkGET /health/ready
- Readiness check
🎯 Personality Types
little_adventurers
- Families with kidsdate_night
- Romantic couplessquad_goals
- Friend groupszen_masters
- Peace seekersactive_lifestyle
- Fitness enthusiastswildlife_lover
- Nature enthusiastsart_nerd
- Art and culture lovershistory_geek
- History enthusiasts
🗺️ Berlin Neighborhoods
- Mitte, Kreuzberg, Friedrichshain, Prenzlauer Berg
- Charlottenburg, Wilmersdorf, Schöneberg, Tempelhof
- Neukölln, Pankow, Wedding, Moabit
📊 Scoring Factors
- Tree coverage and shade
- Noise levels
- Wildlife diversity
- Nearby amenities (Späti, restaurants, toilets)
- Playgrounds and water features
- Public transport accessibility
- Fitness facilities and paths
🚀 Deployment
Docker
# Build image
docker build -t berlin-picnic-api .
# Run container
docker run -p 8000:8000 berlin-picnic-api
Docker Compose
# Start all services
docker-compose up -d
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
📄 License
MIT License - see LICENSE file for details
📞 Support
- GitHub Issues: Create an issue
- Email: your.email@example.com