English · Español · Français · Deutsch · 中文 · العربية
Turn CAD, DWG and PDF floor plans into live 3D indoor maps and digital twins. Map warehouses, hospitals, malls, factories and campuses floor by floor, then connect live data from RTLS, RFID, BLE and IoT sensors, your WMS or ERP, or any table, webhook or API, and watch it on the map with heatmaps, alerts, turn-by-turn wayfinding, dashboards and reports. Self-hosted with Docker. MIT.
Documentation · Cloud version · Quick start · Features · Releases · Contributing
One app for every kind of building. Each of these is a facility built in Spatial Map: floors drawn over the real floor plan, live data on top.
- Workspaces, members and custom roles: four built-in roles plus your own permission sets; admins can create accounts directly; viewers are read-only on the API, not just in the UI.
- Tables with CSV/XLSX import, a REST API and bearer tokens per table, polling sources and row history.
- Solutions group facilities, reports and data (e.g. "Anti-theft").
- Six languages (English, Spanish, French, German, Chinese, Arabic with RTL), light/dark themes and 46 colour palettes.
- An optional AI floor-plan tool that detects rooms and walls.
- Self-hosted means everything is unlocked: no plans, no limits, no telemetry.
Prefer not to host it yourself? spatialmap.io is the managed cloud version of Spatial Map.
| Version | Highlights |
|---|---|
| 0.3.0 | Alerts, custom roles, admins create accounts, a complete "Duplicate facility", welcome tour, sign-up guard |
| 0.2.0 | Focus mode, measure and calibrate, wall joins, leaning walls, path-layout racks, multi-floor routing, heatmaps, clustering, master reports, report share links, 3D export |
| 0.1.1 | Security: workspace routes require a sign-in or the configured API key |
Full list: CHANGELOG.md.
| Warehouses and logistics (WMS) | Racks and bins coloured by stock, pick paths, dock doors, forklifts and pickers on the map, inbound / outbound dashboards |
| Hospitals and healthcare (RTLS) | Staff, patient and equipment locations, room occupancy, cold-chain and environment alerts |
| Retail, malls and supermarkets | Store layouts, shelves and fixtures, footfall heatmaps, anti-theft alerts, in-store wayfinding |
| Manufacturing and factories (IoT) | Machines and sensors on the floor plan, live status, maintenance and safety alerts |
| Offices, campuses, venues and museums | Rooms, desks and assets, visitor wayfinding, event layouts |
You need Docker (Compose v2.20+) and a free Mapbox access token.
git clone https://github.com/Siraj-zaki/spatial-map.git
cd spatial-map
cp .env.example .env # set VITE_MAPBOX_ACCESS_TOKEN=pk....
docker compose up -d # first run builds the images (a few minutes)Open http://localhost:3000 and sign up. Without SMTP configured, the email code is printed in the API log:
docker compose logs api | grep -i "verification code"To skip the build and use the published images, run docker compose pull
before up. To create an admin account on first start, set
SPATIAL_MAP_ADMIN_EMAIL / SPATIAL_MAP_ADMIN_PASSWORD in .env. The
optional AI floor-plan tool adds a ~1.7 GB worker:
docker compose --profile ai up -d.
A fresh install comes with a shared Demo workspace: five sample
facilities (a hospital, a retail mall, a warehouse, a supermarket and a retail
store) with floors, racks, live data tables, data links and 84 ready-made
reports, including a full-map RFID dashboard. It is loaded once, on the first
start of an empty database; every new account joins it as an editor and lands
there first, next to a workspace of its own. Delete it from Workspaces when
you no longer need it, or set SPATIAL_MAP_DEMO=false before the first
start to begin empty.
Every table has its own REST API and bearer tokens (Tables → your table → API & Integrations). Push a row from anywhere: an RTLS server, an IoT gateway, your WMS or ERP, or a script:
curl -X POST http://localhost:3000/api/v1/public/tables/rows \
-H "Authorization: Bearer $SPATIAL_MAP_TABLE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"entityKey": "cam-07", "payload": {"name": "Camera 7", "status": "online"}, "position": [-81.7006, 41.5004]}'Then link the table to a facility in the editor (Data links) and the row shows up on the map, styled by your rules, as soon as it changes. Other ways in: webhooks, live WebSocket streams, REST polling of your own API, and CSV / XLSX / GeoJSON import.
The user guide lives at spatialmap.io/docs:
- Getting started · Facilities
- Editor overview · Keyboard shortcuts · Floor plans
- Viewer · Share links
- Data links · Integrations · Tables & REST API
The guide describes the cloud version; the self-hosted edition is the same app without plans or billing. Technical docs for running and changing the code are in this repository:
| ARCHITECTURE.md | Every file, route, table and design decision |
| docs/ | Frontend, backend, pitfalls, CAD import, AI tool, workflow |
| AGENTS.md | Conventions for contributors and AI coding agents |
| SECURITY.md | Production hardening and reporting vulnerabilities |
All settings for docker compose go in .env; every option is documented in
.env.example. The ones you'll want for production:
| Variable | What |
|---|---|
VITE_MAPBOX_ACCESS_TOKEN |
Required. Mapbox public token (set at container start, no rebuild) |
SPATIAL_MAP_PUBLIC_URL |
Public URL of the app, used in auth emails |
SPATIAL_MAP_MODE=production |
Refuses to start with placeholder secrets |
SPATIAL_MAP_JWT_SECRET, SPATIAL_MAP_API_KEY |
Session signing secret and machine API key (openssl rand -hex 32 each) |
SPATIAL_MAP_DB_PASSWORD, SPATIAL_MAP_MINIO_USER/PASSWORD |
Database and object-storage credentials (set before the first start) |
SPATIAL_MAP_SMTP_* |
SMTP for sign-up and password-reset codes |
SPATIAL_MAP_PORT |
Port the app is served on (default 3000) |
SPATIAL_MAP_DEMO |
Load the demo workspace into an empty database (default true) |
SPATIAL_MAP_SIGNUP_GUARD |
Sign-up abuse guards for a server open to the internet: one account per Gmail inbox, no throwaway inboxes, at most 3 new accounts per network per day (default false) |
Put a TLS-terminating reverse proxy (Caddy, nginx, Traefik) in front of port
3000 for anything public. The API reads SGV_* settings as well
(backend/config.prod.example.yaml documents each one); see
SECURITY.md.
Basemaps come from Mapbox's public styles (map-styles.json); point an entry at your own Mapbox Studio style to change the look.
cp .env.example .env # set VITE_MAPBOX_ACCESS_TOKEN
docker compose -f backend/docker-compose.yml up -d # Postgres, MinIO, Redis + API on :8080
npm install && npm run dev # SPA on http://localhost:5173npx tsc -p tsconfig.app.json --noEmit # typecheck
npm run lint # ESLint
npm run build # production build
npm run e2e # Playwright (needs the backend running)
cd backend && make test # Go tests (testcontainers → needs Docker)
cd backend && make sqlc # regenerate DB code after editing queries/*.sqlsrc/ React 19 + TypeScript SPA (routes, components, stores, map overlays, reports)
public/ static assets, locales (6 languages), bundled 3D models
backend/ Go API (cmd/, internal/, migrations/, queries/ for sqlc)
backend/ai-worker/ optional Python CV worker for the AI floor-plan tool
docker/ web container (nginx + runtime config)
worker/ optional Cloudflare Worker for local pub/sub / webhook testing
scripts/ model build, thumbnails, seeders, live-feed simulator
e2e/ Playwright end-to-end tests
Stack: React 19 · TypeScript · Vite · Mapbox GL 3 · Zustand · Tailwind · shadcn/ui · Go 1.25 · Chi · sqlc · PostgreSQL/PostGIS · MinIO · Redis.
Issues and pull requests are welcome. Read CONTRIBUTING.md and AGENTS.md first (the codebase has a few firm conventions: spatial store, tenant scoping, i18n in six languages, theme tokens), and follow the Code of Conduct. Report security issues privately (SECURITY.md). Changes are listed in CHANGELOG.md.
If Spatial Map is useful to you, a ⭐ on GitHub helps other people find it.
MIT © Spatial Map contributors. Bundled 3D models are CC BY 4.0 and need attribution; see CREDITS.md. Map data and tiles are © Mapbox and © OpenStreetMap contributors.



















