不動産投資データ可視化プラットフォーム (47 都道府県対応)
国土交通省の公示地価・災害リスク・施設データを統合し、24 レイヤーの空間データを 3D マップ上に重畳表示。独自の投資スコア (TLS: 0-100) と WASM 空間エンジンで不動産投資の意思決定を支援する。
Layer
Technology
Backend
Rust (Axum + Tokio + SQLx + PostGIS)
Frontend
Vite SPA + React 19 + Mapbox GL JS + shadcn/ui + Tailwind CSS v4
WASM
Rust → wasm-bindgen → Web Worker (R-tree spatial queries)
Database
PostgreSQL 16 + PostGIS 3.4
Infra
Docker Compose (nginx + Rust backend + PostGIS)
# Clone and configure
git clone https://github.com/sdn0303/terrasight.git && cd terrasight
cp .env.example .env # Edit DB_PASSWORD, optional REINFOLIB_API_KEY
# Start all services
docker compose up -d --build
# Import data (Tokyo, priority P0)
./scripts/commands/pipeline.sh 13 P0
Local Development (without Docker)
# 1. Start DB only
docker compose up -d db
# 2. Backend
cd services/backend && cargo run
# 3. Frontend (separate terminal)
cd services/frontend && pnpm install && pnpm dev
# 4. Import data
./scripts/commands/pipeline.sh 13 P0
services/
├── backend/ # Rust Axum API (Clean Architecture: handler/usecase/domain/infra)
├── frontend/ # Vite SPA (features/components/stores/hooks)
└── wasm/ # Rust WASM spatial engine (R-tree, FlatGeobuf)
Variable
Required
Description
DB_PASSWORD
Yes
PostgreSQL password (default: devpass)
REINFOLIB_API_KEY
No
MLIT Reinfolib API key (enables live transaction data)
ESTAT_APP_ID
No
e-Stat API key (population data)
RUST_LOG
No
Log level filter (default: info)
VITE_API_URL
No
Backend URL for frontend (default: http://localhost:8000)
# Backend
cd services/backend && cargo build && cargo test && cargo clippy -- -D warnings
# Frontend
cd services/frontend && pnpm tsc --noEmit && pnpm biome check src/ && pnpm vitest run
# WASM
cd services/wasm && cargo test
Hook
Backend
Frontend
WASM
pre-commit
cargo fmt, cargo clippy
biome check, tsc
cargo fmt, cargo clippy
pre-push
cargo build, cargo test
vitest run, vite build
cargo test
# Full pipeline (convert + FlatGeobuf + import + validate)
./scripts/commands/pipeline.sh < pref_code> < priority>
# Examples
./scripts/commands/pipeline.sh 13 P0 # Tokyo
./scripts/commands/pipeline.sh 27 P0 # Osaka
# Individual steps
uv run scripts/tools/pipeline/convert.py --pref 13 --priority P0
uv run scripts/tools/pipeline/build_fgb.py --pref 13
uv run scripts/tools/pipeline/import_db.py --pref 13 --priority P0
MIT