Spaces:
Sleeping
Sleeping
Jack commited on
Commit ·
531eb3f
1
Parent(s): 4a3d07b
bug fixes, renaming to TravelMap
Browse files- README.md +7 -67
- app/config.py +1 -1
- app/content.py +1 -1
- app/templates/base.html +1 -1
README.md
CHANGED
|
@@ -1,17 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
sdk: docker
|
| 4 |
app_port: 7860
|
| 5 |
---
|
| 6 |
|
| 7 |
-
#
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
- A real browser-facing UI with search, listing pages, booking, wishlists, messaging, trips, and host controls
|
| 12 |
-
- Deterministic seeded accounts and hidden automation endpoints for reproducible flows
|
| 13 |
-
- Reset and inspection endpoints for reproducible evaluation loops
|
| 14 |
-
- A single-container Docker deployment that is compatible with Hugging Face Docker Spaces
|
| 15 |
|
| 16 |
## Accounts
|
| 17 |
|
|
@@ -23,75 +18,20 @@ All demo accounts use the password `demo123`.
|
|
| 23 |
- `priya@example.com` - host
|
| 24 |
- `leo@example.com` - guest
|
| 25 |
|
| 26 |
-
## Local Run
|
| 27 |
-
|
| 28 |
-
```bash
|
| 29 |
-
python3 -m venv .venv
|
| 30 |
-
source .venv/bin/activate
|
| 31 |
-
pip install -r requirements.txt
|
| 32 |
-
python3 scripts/reset_data.py
|
| 33 |
-
python3 -m uvicorn app.main:app --host 0.0.0.0 --port 7860
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
Open `http://localhost:7860`.
|
| 37 |
-
|
| 38 |
## Docker
|
| 39 |
|
| 40 |
```bash
|
| 41 |
docker compose up --build
|
| 42 |
```
|
| 43 |
|
| 44 |
-
The app
|
|
|
|
| 45 |
|
| 46 |
-
##
|
| 47 |
|
| 48 |
-
Reset the
|
| 49 |
|
| 50 |
```bash
|
| 51 |
python3 scripts/reset_data.py
|
| 52 |
```
|
| 53 |
|
| 54 |
-
Or through the HTTP API:
|
| 55 |
-
|
| 56 |
-
```bash
|
| 57 |
-
curl -X POST http://localhost:7860/api/reset
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
If you set a `RESET_TOKEN` environment variable, pass it as a query string:
|
| 61 |
-
|
| 62 |
-
```bash
|
| 63 |
-
curl -X POST "http://localhost:7860/api/reset?token=your-token"
|
| 64 |
-
```
|
| 65 |
-
|
| 66 |
-
## Useful Endpoints
|
| 67 |
-
|
| 68 |
-
- `/` - listing search and discovery
|
| 69 |
-
- `/guide` - account chooser
|
| 70 |
-
- `/trips` - booking management
|
| 71 |
-
- `/wishlists` - saved listings
|
| 72 |
-
- `/inbox` - guest and host messaging
|
| 73 |
-
- `/host` - host calendar blocking and reservation view
|
| 74 |
-
- `/api/tasks` - hidden task catalog for automation
|
| 75 |
-
- `/api/tasks/{id}` - a single task record
|
| 76 |
-
- `/api/tasks/{id}/evaluate` - task validation against current state
|
| 77 |
-
- `/api/state` - serialized state snapshot
|
| 78 |
-
- `/api/reset` - reset the environment to the seed
|
| 79 |
-
- `/docs` - FastAPI API docs
|
| 80 |
-
|
| 81 |
-
## Hugging Face Spaces
|
| 82 |
-
|
| 83 |
-
This repo is already prepared for a Docker Space:
|
| 84 |
-
|
| 85 |
-
- `README.md` front matter sets `sdk: docker` and `app_port: 7860`
|
| 86 |
-
- The container runs `uvicorn` on port `7860`
|
| 87 |
-
- The app serves a valid root page at `/`, which helps the Space health check
|
| 88 |
-
|
| 89 |
-
Push the repo to a Hugging Face Space configured for Docker and it should boot directly.
|
| 90 |
-
|
| 91 |
-
## Testing
|
| 92 |
-
|
| 93 |
-
Run the smoke test suite after installing dependencies:
|
| 94 |
-
|
| 95 |
-
```bash
|
| 96 |
-
python3 -m unittest discover -s tests
|
| 97 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
title: TravelMap
|
| 3 |
sdk: docker
|
| 4 |
app_port: 7860
|
| 5 |
---
|
| 6 |
|
| 7 |
+
# TravelMap
|
| 8 |
|
| 9 |
+
TravelMap is a lightweight Airbnb-style demo app with browsing, booking, saved homes, trips, messaging, and simple host tools.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
## Accounts
|
| 12 |
|
|
|
|
| 18 |
- `priya@example.com` - host
|
| 19 |
- `leo@example.com` - guest
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
## Docker
|
| 22 |
|
| 23 |
```bash
|
| 24 |
docker compose up --build
|
| 25 |
```
|
| 26 |
|
| 27 |
+
The app runs on port `7860`.
|
| 28 |
+
Open `http://localhost:7860` in your browser.
|
| 29 |
|
| 30 |
+
## Reset Data
|
| 31 |
|
| 32 |
+
Reset the app back to its seeded demo state:
|
| 33 |
|
| 34 |
```bash
|
| 35 |
python3 scripts/reset_data.py
|
| 36 |
```
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/config.py
CHANGED
|
@@ -11,7 +11,7 @@ DATA_DIR = BASE_DIR / "data"
|
|
| 11 |
|
| 12 |
@dataclass(frozen=True)
|
| 13 |
class Settings:
|
| 14 |
-
app_name: str = os.getenv("APP_NAME", "
|
| 15 |
database_url: str = os.getenv(
|
| 16 |
"DATABASE_URL",
|
| 17 |
f"sqlite:///{(DATA_DIR / 'webarena_airbnb.db').as_posix()}",
|
|
|
|
| 11 |
|
| 12 |
@dataclass(frozen=True)
|
| 13 |
class Settings:
|
| 14 |
+
app_name: str = os.getenv("APP_NAME", "TravelMap")
|
| 15 |
database_url: str = os.getenv(
|
| 16 |
"DATABASE_URL",
|
| 17 |
f"sqlite:///{(DATA_DIR / 'webarena_airbnb.db').as_posix()}",
|
app/content.py
CHANGED
|
@@ -4,7 +4,7 @@ from typing import Any
|
|
| 4 |
|
| 5 |
|
| 6 |
SITE_CONTENT = {
|
| 7 |
-
"name": "
|
| 8 |
"tagline": "Easy stays, well chosen.",
|
| 9 |
"hero_eyebrow": "Homes for city breaks, design weekends, and longer exhale trips",
|
| 10 |
"hero_title": "Find the kind of place that changes the trip.",
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
SITE_CONTENT = {
|
| 7 |
+
"name": "TravelMap",
|
| 8 |
"tagline": "Easy stays, well chosen.",
|
| 9 |
"hero_eyebrow": "Homes for city breaks, design weekends, and longer exhale trips",
|
| 10 |
"hero_title": "Find the kind of place that changes the trip.",
|
app/templates/base.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<div class="page-shell">
|
| 11 |
<header class="site-header">
|
| 12 |
<a class="brand" href="/">
|
| 13 |
-
<span class="brand-mark">
|
| 14 |
<span>
|
| 15 |
<strong>{{ site_content.name }}</strong>
|
| 16 |
<small>{{ site_content.tagline }}</small>
|
|
|
|
| 10 |
<div class="page-shell">
|
| 11 |
<header class="site-header">
|
| 12 |
<a class="brand" href="/">
|
| 13 |
+
<span class="brand-mark">TM</span>
|
| 14 |
<span>
|
| 15 |
<strong>{{ site_content.name }}</strong>
|
| 16 |
<small>{{ site_content.tagline }}</small>
|