This commit is contained in:
2026-06-17 01:15:52 +09:00

View File

@@ -1,23 +1,29 @@
# Map Journal
**Author:** _[Your Name]_
**Student ID:** _[Your ID]_
**Email:** _[Your Email]_
**Authors:** Tomas Horsky, Haeri Kim
**Student IDs:** 20256426, <ID>
**Emails:** tomashorsky@kaist.ac.kr , <Email>
**Live website:** <https://map-jurnal.web.app/>
**Repository:** <https://git.prototyping.id/20256426/Map-Jurnal.git>
**Repository:** <https://git.prototyping.id/20256426/Map-Jurnal.git>
**Video Demo:** _[YouTube URL]_
---
## Overview
Map Journal is a single-page web application for documenting and visualizing travel experiences. Users log trips by country, pinning cities, dates, transport modes, and photos, and then explore their journey on an interactive world map or a timeline view.
Journi is a web application for journaling and visualizing travel experiences. Users log trips by country, pinning cities, dates, transport modes, and photos. Then user can explore their journey on an interactive world map, timeline view or can play short animations overviewing his trips.
### How It Works
1. **Sign in** with a Google account.
2. **Select your home country** — it is automatically marked as visited on the map.
3. **Add journal entries** via a multi-step form:
3. **Add journal entries**:
- **Step 0** — Click on country in map you visited or click add trip in timeline.
- **Step 1** — Choose country, cities, arrival date, days stayed, trip type (solo/friends/family), and transport (flight/train/bus/car/ship/walk).
- **Step 2** — Upload photos (stored in Firebase Storage).
- **Step 3** — Answer three random reflective questions about the trip (e.g., *"What was the most unexpected thing that happened?"*).
@@ -110,63 +116,7 @@ App.svelte
└── SharePreview.svelte
```
### Data Flow
```
Firebase Auth ──→ userStore.svelte.js ──→ Layout (auth guard)
Firebase Firestore ──→ entriesStore.svelte.js ──→ Timeline, Map (via $state/$derived)
Firebase Storage ──→ PhotoEditor.svelte (upload)
selection.svelte.js ──→ visited set (derived from entries + home country)
```
### Key Patterns
- **Svelte 5 runes** — `$state`, `$derived`, `$effect`, `$bindable`, `$props` replace the old Svelte store/reactivity model.
- **$bindable props** — `TripBasicInfo` uses `$bindable()` for two-way binding with its parent form, keeping form state in the parent while delegating UI rendering.
- **Firebase listeners** — `entriesStore` uses `onSnapshot` for real-time Firestore sync; `userStore` uses `onAuthStateChanged`.
- **D3.js** — `WorldMap` renders a GeoJSON world map with centered zoom via `d3-geo`; `JourneyView` animates SVG flight paths.
- **No framework router** — the app uses a simple `mode` state variable (`'map' | 'journal'`) in `App.svelte` to switch between views.
---
## Features
| Feature | Details |
|---------|---------|
| Google sign-in | Firebase Auth with `GoogleAuthProvider` |
| Interactive world map | D3projected map with country highlighting, zoom, and pan |
| Animated journeys | Flightpath arcs between entries, played sequentially |
| Multistep forms | 3step wizard for both new and edit modes |
| Photo upload | Firebase Storage with CORS support, error display |
| Random trip questions | 10 curated prompts, 3 randomly chosen per entry |
| Share card | Autogenerated trip summary image via `html-to-image` |
| Home country marker | 16×16 icon placed at country centroid on map |
| Tooltips | Country name shown on hover, offset 22px from cursor |
---
## Known Bugs & Limitations
- **Photo Editor** — The `.add-btn` CSS class is unused (replaced by `.add-cell`); leftover from refactoring.
- **ShareCard** — Several CSS classes (`.stat-grid`, `.stat-box`, `.cont-section`, etc.) are defined but unused in the template; they were intended for a statistics section that was not implemented.
- **Photo upload error** — If Firebase Storage upload fails, the error is displayed but the photo grid does not automatically roll back the failed entry.
- **State_referenced_locally warnings** — `EditForm.svelte` initializes `$state` variables from `$props()` at declaration; this is intentional (onetime init on edit mode) but Svelte 5's analyzer emits warnings.
- **A11y warnings** — Some form labels lack `for`/`id` associations (transport pills, triptype toggles); these are visualonly controls where the label wraps the input, which is functional but not strictly valid per WAIARIA.
---
## Dependencies
| Package | Purpose |
|---------|---------|
| `svelte` ^5.55 | UI framework (runes, snippets, `$props`) |
| `firebase` ^12 | Auth, Firestore, Storage |
| `d3` ^7 | World map projection and SVG rendering |
| `topojson-client` | Convert TopoJSON → GeoJSON for map data |
| `world-atlas` | Country boundary data |
| `html-to-image` | Generate share card PNG |
---
## Setup & Run
@@ -182,11 +132,9 @@ npm install
# VITE_FIREBASE_MESSAGING_SENDER_ID=...
# VITE_FIREBASE_APP_ID=...
# Dev server
# Run server
npm run dev
# Production build
npm run build
```
---
@@ -198,9 +146,4 @@ npm run build
- **Firebase** — Google for the backend suite (Auth, Firestore, Storage).
- **Svelte** — [Svelte team](https://svelte.dev/) for the frontend framework.
- **html-to-image** — [tsayen](https://github.com/bubkoo/html-to-image) for DOM-to-image capture.
- **Flag emoji** — Country-to-flag mapping based on regional indicator symbols.
- **Cursor icon** — Derived from the SVG airplane asset used in the app.
---
_This project was developed as part of a software prototyping course._