A web application for visualizing species observations from the Global Biodiversity Information Facility (GBIF) data, specifically focused on Poland. The application allows users to search for species, view their observations on an interactive map, and analyze temporal patterns through timeline visualizations.
- Species Search: Search for species by scientific name or vernacular name with real-time suggestions
- Interactive Map: Visualize species observations on an interactive map with custom markers
- Timeline Visualization: View temporal distribution of observations using interactive charts
- Dashboard Statistics: Overview of the dataset with key metrics and top observed species
- Responsive Design: Modern, mobile-friendly interface built with React and Tailwind CSS
- FastAPI Backend: High-performance Python API with automatic documentation
- React Frontend: Modern React application with hooks and functional components
- Real-time Search: Debounced search with loading states and error handling
- Data Optimization: Efficient data processing and caching for large datasets
- Unit Tests: Comprehensive test coverage for backend API endpoints
- FastAPI: Modern, fast web framework for building APIs
- Pandas: Data manipulation and analysis
- NumPy: Numerical computing
- Pytest: Testing framework
- Uvicorn: ASGI server
- React 18: Modern React with hooks
- Tailwind CSS: Utility-first CSS framework
- React Leaflet: Interactive maps
- Recharts: Data visualization
- Axios: HTTP client
- Lucide React: Icon library
biodiversity-dashboard/
├── backend/
│ ├── main.py # FastAPI application
│ ├── tests/
│ │ └── test_api.py # Unit tests
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── Header.js
│ │ │ ├── SearchBar.js
│ │ │ ├── MapVisualization.js
│ │ │ ├── TimelineChart.js
│ │ │ ├── SpeciesInfo.js
│ │ │ └── DashboardStats.js
│ │ ├── services/
│ │ │ └── api.js # API service layer
│ │ ├── App.js
│ │ ├── index.js
│ │ └── index.css
│ ├── package.json
│ └── tailwind.config.js
├── scripts/
│ └── download_data.py # Data download script
├── data/ # Data files
└── README.md
- Python 3.8+
- Node.js 16+
- npm or yarn
-
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
cd backend pip install -r requirements.txt
-
Download data:
cd ../scripts python download_data.py
-
Run the backend:
cd ../backend python main.py
The API will be available at http://localhost:8000
-
Install dependencies:
cd frontend npm install
-
Start development server:
npm start
The application will be available at http://localhost:3000
The FastAPI backend provides automatic interactive documentation at:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
GET /health
- Health checkGET /api/species/search?query={query}&limit={limit}
- Search speciesGET /api/species/{species_key}/observations
- Get species observationsGET /api/species/{species_key}/timeline
- Get species timeline dataGET /api/dashboard/stats
- Get dashboard statistics
The application uses data from the Global Biodiversity Information Facility (GBIF):
- Dataset: GBIF occurrence data
- Geographic Scope: Poland (country code: PL)
- Time Range: 2000-2023
- Data Types: Human observations, machine observations
- Quality Filters: Only records with valid coordinates and no geospatial issues
- Data Preprocessing: Species and observations data are preprocessed and stored as CSV files
- Efficient Queries: Pandas operations optimized for large datasets
- Memory Management: Data loaded once at startup to avoid repeated I/O
- Response Caching: API responses are optimized for minimal data transfer
- Debounced Search: Search requests are debounced to reduce API calls
- Component Memoization: React components optimized to prevent unnecessary re-renders
- Lazy Loading: Map and chart components load only when needed
- Efficient State Management: Minimal state updates and proper dependency arrays
- Geographic Filtering: Data filtered to Poland boundaries to reduce dataset size
- Coordinate Validation: Only records with valid coordinates are included
- Temporal Filtering: Focus on recent data (2000-2023) for better performance
- Species Deduplication: Unique species list created to avoid redundant data
Run the test suite:
cd backend
pytest tests/test_api.py -v
Run the test suite:
cd frontend
npm test
The FastAPI application can be deployed using:
- Docker: Containerized deployment
- Cloud Platforms: AWS, Google Cloud, Azure
- VPS: Traditional server deployment
The React application can be deployed to:
- Netlify: Static site hosting
- Vercel: Serverless deployment
- AWS S3: Static website hosting
- GitHub Pages: Free hosting
Create a .env
file in the backend directory:
API_HOST=0.0.0.0
API_PORT=8000
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
- Search for Species: Use the search bar to find species by name
- View Observations: Click on a species to see its observations on the map
- Analyze Timeline: View the temporal distribution of observations
- Explore Data: Use the dashboard statistics to understand the dataset
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License.
- GBIF: Global Biodiversity Information Facility for providing the data
- OpenStreetMap: Map tiles and geographic data
- React Community: For the excellent ecosystem and tools
- FastAPI: For the modern Python web framework
- Advanced Filtering: Filter by date range, location, or observation type
- Species Comparison: Compare multiple species side by side
- Export Functionality: Export data and visualizations
- Mobile App: Native mobile application
- Real-time Updates: Live data updates from GBIF
- Machine Learning: Species prediction and classification
- Social Features: User accounts and saved searches
- Data not loading: Ensure the data download script has run successfully
- CORS errors: Check that the backend CORS settings include your frontend URL
- Map not displaying: Verify that Leaflet CSS is properly imported
- Search not working: Check the API connection and network requests
- Slow search: Reduce the dataset size or implement server-side pagination
- Map lag: Limit the number of markers displayed at once
- Memory usage: Monitor data loading and implement data pagination
For questions or issues, please:
- Check the troubleshooting section
- Review the API documentation
- Create an issue in the repository
- Contact the development team
Built with ❤️ for biodiversity conservation and data visualization.