A web platform for discovering and photographing heritage monuments across Turkey. Created for the Wiki Loves Monuments 2025 competition.
This is basically a prettier, faster way to find monuments that need photos for Wikimedia Commons. Instead of digging through Wikidata queries or category pages, you get:
- Interactive map showing all monuments curated by Kültür Envanteri and queried from Wikidata
- Quick upload - take a photo with your phone, add basic info, done
- Smart filters - find monuments near you or in specific cities
- Direct integration with Wikimedia Commons via OAuth
The whole thing syncs monument data from Wikidata/Structured Data on Commons daily, so it stays fresh.
- PHP 8.2+ (running on 8.4)
- Composer
- Node.js & npm
- SQLite (or swap to MySQL/PostgreSQL if you prefer on prod)
# Clone and install
git clone https://github.com/ooguz/wlmtr.git
cd wlmtr
composer install
npm install
# Setup environment
cp .env.example .env
php artisan key:generate
# Create database (SQLite by default)
touch database/database.sqlite
# Run migrations
php artisan migrate
# Build assets
npm run buildYou'll need to register an OAuth application on Wikimedia:
-
Go to https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose
-
Create a new OAuth 2.0 client
-
Request these grants:
- Basic rights
- High-volume editing
- Edit existing pages
- Create, edit, and move pages
- Upload new files
- Upload, replace, and move files
-
NEVER FORGET YOU CANNOT CHANGE YOUR CALLBACK URI. I needed to apply for several times.
-
Add those to
.env:
WIKIMEDIA_CLIENT_ID=your_client_id
WIKIMEDIA_CLIENT_SECRET=your_client_secret
WIKIMEDIA_REDIRECT_URI=http://localhost:8000/auth/wikimedia/callback
# Quick start (runs server, queue, logs, and vite)
composer run dev
# Or manually:
php artisan serve
php artisan queue:listen
npm run devThe app pulls monument data from Wikidata. Initial sync takes a while (we're talking hours for 466k monuments), but after that it's incremental updates.
# Sync all Turkish monuments from Wikidata
php artisan monuments:sync-unified
# Update photos from Commons
php artisan monuments:sync-photos
# Update locations/coordinates
php artisan monuments:sync-locations
# Just sync descriptions
php artisan monuments:sync-descriptionsThese commands queue jobs in Horizon, so make sure php artisan queue:listen is running.
TODO
For Docker deployments, check out docker-compose.yml
- Map with markers of monuments, retrieved via a SPARQL Wikidata query
- List of all monuments, searchable and location-based sortable (monuments near me)
- Upload directly via WLMtr or use Commons advanced wizard
app/
├── Services/
│ ├── WikidataSparqlService.php # SPARQL queries to Wikidata
│ ├── WikimediaCommonsService.php # Upload & photo fetching
│ └── WikimediaAuthService.php # User permission checks
├── Jobs/
│ ├── SyncMonumentsUnifiedJob.php # Main sync job (batched)
│ └── WarmTurkeyMarkersJob.php # Pre-caches map data
└── Models/
├── Monument.php # Core model with relationships
└── Photo.php # Commons photo metadata
# Run all tests
composer test
# Or use Pest directly
vendor/bin/pest
# Watch mode for development
vendor/bin/pest --watchSync jobs timing out?
- Increase
max_execution_timein php.ini - Or sync in smaller batches using
--batch-size=100
Upload failing with CSRF error?
- User probably needs to re-authenticate
- Check if their token expired (4-hour default)
Map not loading monuments?
- Run
php artisan cache:warm-turkey-markersto pre-cache - Check if
monumentstable has data
readapierror?
- Check OAuth2 consumer permissions.
PRs welcome! Just:
- Run
vendor/bin/pintbefore committing (code style) - Add tests for new features
- Keep the quick upload UX smooth
wlmtr - Wiki Loves Monuments Turkey
Copyright (C) 2025 Özcan Oğuz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
This project is created for Wiki Loves Monuments Turkey 2025 within a really limited time window. Monument data is from Kültür Envanteri, an amazing project. Photos from Wikimedia Commons, uploaded by people like us. Map tiles from OpenStreetMap, drawn by people like us. This project become real because of free software, free culture and a group of convinced people who are indefatigably contributing to these projects.
