A premium, open-source Map Poster design tool that allows users to generate high-resolution map posters of any location in the world with curated styling themes and custom typography.
- Real-time Map Selection: Interactive Leaflet map with precise location dragging.
- Reverse Geocoding: Automatically fetches City and Country based on map coordinates.
- Custom Typography: Premium Google Fonts integration with live preview.
- Curated Aesthetics: Multiple color themes (Noir, Midnight Blue, Blueprint, etc.) with thumbnail previews.
- High-Resolution Exports: Uses Python, OSMnx, and Matplotlib to generate print-ready
.pngposters.
- Frontend: Next.js (App Router), React, TypeScript, Leaflet.js, Framer Motion
- Backend: FastAPI (Python), Uvicorn, OSMnx, Matplotlib, Geopy
- Data: OpenStreetMap (OSM) via Overpass API
The backend requires Python 3.9+ and handles the heavy lifting of downloading map data and rendering the posters.
# Navigate to the project root
cd Maptoposter
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start the FastAPI server
python web/backend/main.pyThe backend will be running at http://localhost:8000.
The frontend is a modern Next.js application.
# Navigate to the frontend directory
cd web/frontend
# Install dependencies
npm install
# Start the development server
npm run devThe frontend will be running at http://localhost:3000.
Deploying this application requires hosting the Next.js frontend and the FastAPI backend separately.
Since the backend uses osmnx and matplotlib, it requires a server with enough RAM to process large map grids. A VPS or a service like Render/Railway is recommended.
Using Render (Docker / Web Service)
- Create a
Dockerfilein the root (provided below) or just use the Python environment. - Push the repo to GitHub.
- On Render, create a new "Web Service", connect your repo, and set the Root Directory to
/. - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn web.backend.main:app --host 0.0.0.0 --port $PORT
The easiest way to deploy a Next.js app is via Vercel.
- Go to Vercel and import your GitHub repository.
- Set the Root Directory to
web/frontend. - Add an Environment Variable for the API URL:
NEXT_PUBLIC_API_URL=https://your-backend-url.onrender.com(Note: You will need to updatefetchcalls in the frontend to use this env variable instead of localhost)
- Click Deploy.
- User interacts with the UI (Leaflet).
- Frontend sends
lat,lon,distance,theme, andtextto/api/generate-map. - Backend schedules a background task, downloads OSM data, and plots it with Matplotlib.
- Frontend polls
/api/task-status/{task_id}until completion. - Frontend fetches the final image from the generated
/api/output/{filename}URL.