boettiger-lab/preview-wetlands
0
Wetlands Chatbot & Map Application
Local Development (with Proxies)
To run the full application locally, including backend proxies for CORS and LLM/MCP integration:
- Clone the repository and install dependencies:
git clone https://github.com/boettiger-lab/wetlands.git
cd wetlands
uv pip install -r requirements.txt- Set your API key (required for LLM proxy):
export NRP_API_KEY="your-api-key-here"- Start all backend services (HTTP server, MCP server, MCP proxy, LLM proxy):
./start.sh- This will launch all services in the background and save their PIDs for easy cleanup.
- To stop all services, run:
./stop.sh- Open http://localhost:8000 in your browser to use the app.
Static Deployment (GitHub Pages)
- The frontend (maplibre folder) can be deployed as a static site on GitHub Pages or similar static hosting.
- Limitations: Without the backend proxies, browser requests to MCP/LLM endpoints may fail due to CORS restrictions.
- For full chatbot functionality, use local deployment with proxies as described above.
Configuration
- Endpoints for MCP and LLM are set in
maplibre/config.jsonand proxied via FastAPI apps inapp/mcp_proxy.pyandapp/llm_proxy.py. - Local artifacts (logs, pid files, duck.db) are ignored via
.gitignore.
Troubleshooting
- If you encounter CORS errors or 500/404 errors, ensure all backend proxies are running and endpoints are correctly set in
config.json. - Use
./stop.shto clean up all services before restarting.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
