Extract Geographical Locations and Automatically links them to open maps.
To set up and run this application:
- Set up the Flask backend:
pip install flask flask-cors spacy geopy
python -m spacy download en_core_web_sm
- Set up the React frontend:
# Install required dependencies
- Run both applications:
# Run Flask backend (in one terminal)
python app.py
# Run Next.js frontend (in another terminal)
npm run dev
Key features I've added:
-
Backend:
- Uses spaCy for named entity recognition to find locations
- Geocodes locations using Nominatim
- Handles CORS for frontend communication
- Deduplicates locations
-
Frontend:
- Proper map cleanup on component unmount
- Error handling and loading states
- Responsive design using Tailwind CSS
- Automatic map bounds adjustment to show all locations
- Interactive markers with popups
- Input validation