Skip to content

Find geographical locations and automatically links them to open maps Nextjs for Frontend Flask for backend

Notifications You must be signed in to change notification settings

thinkphp/content2map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

locations2map

Extract Geographical Locations and Automatically links them to open maps.

content2map

To set up and run this application:

  1. Set up the Flask backend:
pip install flask flask-cors spacy geopy
python -m spacy download en_core_web_sm
  1. Set up the React frontend:
# Install required dependencies
  1. 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:

  1. Backend:

    • Uses spaCy for named entity recognition to find locations
    • Geocodes locations using Nominatim
    • Handles CORS for frontend communication
    • Deduplicates locations
  2. 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