Refactor monorepo structure and replace hardcoded colors

Add TypeScript project references, update ESLint configs to support
ESM modules, and introduce brand semantic color tokens across the web
app. Add comprehensive documentation for architecture, API reference,
development setup, and user guide.
This commit is contained in:
2026-05-12 21:22:40 +02:00
parent 98e74ee48d
commit 3c6df95a86
20 changed files with 577 additions and 76 deletions
+93
View File
@@ -0,0 +1,93 @@
# User Guide
Welcome to the TimeToLeave User Guide! This document explains how to use the TimeToLeave web dashboard and mobile application to plan your departures seamlessly.
## 🚀 How TimeToLeave Works
TimeToLeave acts as your personal departure planner. Instead of manually checking train schedules, you simply sync your calendar. The app calculates the best public transport connections to your upcoming appointments, monitors real-time delays, and tells you exactly when to leave home.
### Core Workflow
1. **Sync Your Calendar:** Import your `.ics` file or provide a calendar URL.
2. **Set Your Origin:** Define your home station or let the app use your current location.
3. **Automatic Planning:** The app queries real-time public transport data (via HAFAS and WienerLinien) to find the best connections.
4. **Leave Status:** The dashboard displays a clear status: `Leave now`, `On time`, `Delayed +X min`, or `Departure missed`.
---
## 🌐 Web Dashboard
The web dashboard is designed for planning and monitoring your upcoming events from a desktop or laptop.
### Main Dashboard (`/`)
This is the default view when you open the application. It displays a list of your upcoming events sorted by date. Each event card shows:
- **Event Title & Time:** The name of the appointment and when it starts.
- **Destination Station:** The nearest station to your event.
- **Leave Status:** A color-coded indicator of your current standing:
- 🔴 **Red:** Time is up ("Now") or you're extremely close to departure.
- 🟠 **Orange:** Urgent! You need to leave within 10 minutes.
- 🟡 **Yellow:** Moderate urgency (within 30 minutes).
- 🟢 **Green:** Relaxed (within 60 minutes).
- 🔵 **Blue:** Plenty of time remaining (over 1 hour).
### Calendar Sync (`/calendar`)
Use this page to connect your personal calendar.
- **URL Import:** Paste a public `.ics` calendar URL. The app will fetch upcoming events automatically.
- **File Import:** Upload a `.ics` file directly from your computer.
### Event Details (`/event/[id]`)
Click on any event from the dashboard to view detailed planning information:
- **Journey Options:** A list of available trains/buses with scheduled vs. real departure times.
- **Delay Information:** Real-time delays are highlighted. Cancelled journeys are clearly marked.
- **Local Routing:** See how long it takes to bike or walk from your home to the departure station.
### Manual Event Entry (`/add-event`)
If you don't have a calendar synced, or you have a one-off appointment, you can manually add an event by specifying the title, destination, and time.
---
## 📱 Mobile Application
The mobile app is perfect for on-the-go checks, leveraging your phone's native capabilities.
### Event List Screen
The home screen mirrors the web dashboard, showing your upcoming events and their real-time status. You can pull-to-refresh to get the latest transit data.
### Event Detail Screen
Tap on an event to see:
- The best journey options and real-time platform information.
- A countdown timer to your departure.
- Step-by-step bike/walk directions to the station.
### Calendar Import Screen
Import your calendar directly on the device. The mobile app can read your device's native calendar apps (via `expo-calendar`) if you prefer not to use a remote `.ics` URL.
### Settings Screen
Customize your experience:
- **Buffer Time:** Set a default buffer (e.g., arrive 5 minutes early).
- **Departure Buffer:** Add extra time for the actual transit journey.
- **Toggle Options:** Enable/disable the walking or biking route suggestions based on your preference.
- **Notifications:** Configure push notifications so you get an alert exactly when it's time to leave.
---
## ⏱️ Understanding "Leave Status"
The "Leave Status" is the heart of TimeToLeave. It is calculated dynamically by comparing the **real departure time** of your best non-cancelled journey against the **current time**.
| Status | Meaning |
| :--- | :--- |
| **Leave now** | Your train departs within 15 minutes. Head out! |
| **On time** | Everything is running smoothly, and you have a comfortable window. |
| **Delayed +X min** | Your train is delayed. You can stay home a bit longer! |
| **Departure missed** | The best available journey has already departed. A new search may be required. |
| **All journeys cancelled** | Unfortunately, all connections for this time slot are cancelled. |
## 🔒 Privacy & Data
TimeToLeave is designed with privacy in mind:
- Calendar data is processed server-side solely for the purpose of event extraction and is not permanently stored beyond the active session.
- Geolocation data is used exclusively for calculating routes and finding nearby stations. It is never shared with third parties.
---
*Happy traveling! Built for developers who bike to the train and hate missing their connections.*