diff --git a/README.md b/README.md new file mode 100644 index 0000000..d373335 --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# πŸ—ΊοΈ Rust Vector Map + +A high-performance, GPU-accelerated vector map renderer built with **Rust**, **WebAssembly**, and **ScyllaDB**. + +## πŸš€ Features + +- **GPU Rendering**: Uses `wgpu` to render millions of vertices (buildings, roads, parks) directly on the GPU. +- **WebAssembly**: Core logic runs in Wasm for near-native performance in the browser. +- **Scalable Backend**: Powered by **ScyllaDB** to handle massive OpenStreetMap datasets with low latency. +- **Custom Vector Tiles**: Efficient binary format for fast network transfer and parsing. +- **Interactive**: Smooth zooming, panning, and dynamic level-of-detail. + +## πŸ—οΈ Architecture + +- **Frontend**: Rust (`winit`, `wgpu`, `wasm-bindgen`) compiled to WebAssembly. +- **Backend**: Rust (`Axum`) REST API serving tile data. +- **Database**: ScyllaDB (Cassandra-compatible) storing processed OSM data. +- **Importer**: Custom Rust tool (`osmpbf`) to ingest `.osm.pbf` files. + +## πŸ› οΈ Getting Started + +### Prerequisites + +- [Rust](https://rustup.rs/) (latest stable) +- [Docker](https://www.docker.com/) & Docker Compose +- `wasm-pack`: `cargo install wasm-pack` + +### 1. Start the Database + +Start ScyllaDB in a container: + +```bash +docker compose up -d scylla +``` + +### 2. Import Data + +1. Download an OpenStreetMap PBF file (e.g., from [Geofabrik](https://download.geofabrik.de/)). +2. Save it as `sample.osm.pbf` in the project root. +3. Run the importer: + +```bash +cargo run --bin importer +``` + +*Note: This process may take a few minutes depending on the size of the PBF file.* + +### 3. Run the Application + +**Option A: Docker (Recommended)** + +Build and run the entire stack: + +```bash +docker compose up --build +``` + +**Option B: Manual (Development)** + +1. **Build Frontend**: + ```bash + cd frontend + wasm-pack build --target web --out-name wasm --out-dir ../backend/static + cd .. + ``` + +2. **Run Backend**: + ```bash + cargo run --bin backend + ``` + +### 4. View the Map + +Open your browser and navigate to: + +``` +http://localhost:3000 +``` + +## πŸ“‚ Project Structure + +- `/backend`: Axum server and database logic. +- `/frontend`: Rust Wasm application and rendering engine. +- `/importer`: Tool for parsing and ingesting OSM data. +- `docker-compose.yml`: Service orchestration. + +## πŸ“œ License + +MIT License diff --git a/docker-compose.yml b/docker-compose.yml index 6a02715..8836107 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: - "9042:9042" - "9160:9160" - "10000:10000" - command: --smp 1 --memory 2G --overprovisioned 1 --api-address 0.0.0.0 --max-memory-for-unlimited-query-soft-limit 1073741824 --tombstone-warn-threshold 10000000 + command: --smp 1 --memory 4G --overprovisioned 1 --api-address 0.0.0.0 --max-memory-for-unlimited-query-soft-limit 1073741824 --tombstone-warn-threshold 10000000 volumes: - scylla_data:/var/lib/scylla