AxI Itinerary is a web application designed as a travel itinerary planner and guidebook, helping users organize and manage their trips effectively.
This project uses a modern web architecture with the following components:
- Cloudflare Workers: Serverless edge computing for API endpoints and data processing.
- D1 Database: Fast, SQLite-compatible database for storing itinerary data.
- Svelte: Lightweight frontend framework for responsive UI.
- Rust (WebAssembly): High-performance client-side logic for complex calculations like itinerary optimization and data manipulation.
- Rust's Role: Rust compiles to WebAssembly, enabling fast, safe execution of heavy computations (e.g., route planning, budget calculations) directly in the browser without server round-trips.
- Backend Structure: The "backend" is split into two parts:
- Server-side: Cloudflare Workers handle API routes and database interactions.
- Client-side: Rust WASM library provides performant logic for the frontend.
- Tech Choices: Cloudflare Workers offer global edge deployment with low latency. D1 ensures quick queries. Svelte keeps the UI snappy. Rust WASM avoids JavaScript performance bottlenecks for CPU-intensive tasks.
- Node.js (version 18 or higher)
- pnpm
- Rust (with wasm-pack)
- Cloudflare Wrangler CLI
-
Clone the repository.
git clone https://github.com/soranjiro/AxI-itinerary.git cd AxI-itinerary
-
Install dependencies.
pnpm install
-
Add the Rust WASM target (first time only).
rustup target add wasm32-unknown-unknown
-
Install wasm-pack (first time only).
cargo install wasm-pack
Use D1 Database locally.
-
Create the D1 database (first time only).
wrangler d1 create axi-itinerary-db --local
-
Apply migrations.
wrangler d1 migrations apply axi-itinerary-db --local
-
Check migrations.
wrangler d1 migrations list axi-itinerary-db --local
-
Verify database contents (optional).
wrangler d1 execute axi-itinerary-db --local --command "SELECT name FROM sqlite_master WHERE type='table';" wrangler d1 execute axi-itinerary-db --local --command "SELECT * FROM users;"
make dev
This builds the WASM library and starts the local Cloudflare Workers development server. Access the app at http://localhost:8787
in your browser.
make build
make deploy