Add setup guide and ignore local backend data

This commit is contained in:
André Rüegger 2026-06-05 16:53:10 +02:00
parent 4de130e608
commit a8207c4f7b
4 changed files with 100 additions and 211 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ Lession_material
*.DS_Store
.aider*
backend/uploads/
backend/data/*.json

118
README.md
View File

@ -1,37 +1,117 @@
# Travel Journal (Draft README)
## Projectdescription
On this website you can document your travelstories.
Where you where, what you did and what videos and pictures you took.
Keep your journal and share it with friends or just log it for your memory.
# Travel Journal
## Project Description
On this website you can document your travel stories: where you were, what you did, and which videos and pictures you took. Keep your journal for yourself or share it with others.
## Pages
### Map Page
Here you can create a journey through setting marker on a map.
At each marker you can write notes or implement images.
Create a journey by placing markers on a map. Each marker can contain notes, dates, images, and videos.
### Blog Page
Here you can look at all notes from one journey.
The markers have a date so they are in a time order.
View the notes from one journey as a blog post. Markers are shown as chapters in date order.
### Journey Explorer
Here you can search for all journeys. Like overview page from a blogwebsite.
Browse and open existing journeys.
## Features
- Blog entry
- Log places
- Add pictures to specific places
- Create and edit journeys
- Add markers/chapters to a map
- Add text, dates, videos, and images to markers
- View journeys as blog posts
- Register, log in, and save journeys through the backend
## Installation
TBD
## Setup And Running
## Tech-Stack
The app has two parts that must run at the same time:
- Backend API: Flask, running on `http://127.0.0.1:5000`
- Frontend: static HTML/CSS/JavaScript, running on `http://127.0.0.1:8000`
Use `127.0.0.1` for both frontend and backend while developing. Mixing `localhost` and `127.0.0.1` can cause login/session cookies to fail.
### Software Requirements
- Python 3.12 or newer
- A terminal such as PowerShell, Command Prompt, or Git Bash
- Optional: `uv` for dependency management
### Backend Setup With uv
From the project root:
```powershell
cd backend
uv sync
uv run python app.py
```
The backend should show:
```text
Running on http://127.0.0.1:5000
```
Leave this terminal running.
### Backend Setup With requirements.txt
If you are not using `uv`, create and activate a virtual environment manually.
From the project root:
```powershell
cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python app.py
```
If the virtual environment already exists, you can skip `python -m venv .venv`.
The backend should show:
```text
Running on http://127.0.0.1:5000
```
Leave this terminal running.
### Frontend Setup
Open a second terminal from the project root:
```powershell
python -m http.server 8000
```
Then open:
```text
http://127.0.0.1:8000/login.html
```
Keep both terminals open while using the app.
### Daily Development Workflow
1. Start the backend in `backend/`.
2. Start the frontend server from the project root.
3. Open `http://127.0.0.1:8000/login.html`.
4. Register or log in.
5. Use the map and blog pages.
If backend code changes, restart the backend with `Ctrl + C` and run `python app.py` again. If frontend HTML/CSS/JS changes, usually a hard browser reload is enough: `Ctrl + Shift + R`.
## Tech Stack
- HTML
- CSS
- JavaScript
- WebGL - MapLibre
- Python
- Flask
- Leaflet / OpenStreetMap
## Members
- Flepp Stiafen
- Kohler Joshua
- Rüegger André
- Ruegger Andre

View File

@ -1,172 +0,0 @@
[
{
"id": 1,
"owner_id": 1,
"title": "Test journey",
"description": "test",
"markers": [
{
"lat": 46.638122462379656,
"lng": 4.806518554687501,
"title": "New test again",
"date": "2026-03-03",
"description": "asfasfadsfsa",
"image": "",
"videoUrl": "https://duckduckgo.com/?t=ffab&q=pythong+gif&ia=images&iax=images&iai=https%3A%2F%2Fmedia.tenor.com%2FfMUOPRVdSzUAAAAM%2Fpython.gif"
},
{
"lat": 47.12621341795227,
"lng": 6.943359375000001,
"title": "safasf",
"date": "",
"description": "sdfadsa",
"image": "",
"videoUrl": ""
},
{
"lat": 46.46813299215556,
"lng": 6.7730712890625,
"title": "asfaf",
"date": "",
"description": "asdfsafa",
"image": "",
"videoUrl": ""
}
],
"created_at": "2026-03-28T16:34:31.421684",
"visibility": "private",
"shared_read": [],
"shared_edit": [],
"comments": [
{
"id": 1774716476571,
"author_id": 1,
"author_name": "josh",
"text": "safasdf",
"created_at": "2026-03-28T17:47:56.571469"
}
]
},
{
"id": 2,
"owner_id": 3,
"title": "New Journey",
"description": "test",
"markers": [
{
"lat": 46.89023157359399,
"lng": 6.789550781250001,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 47.05141149430736,
"lng": 10.4205322265625,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 46.58906908309185,
"lng": 10.310668945312502,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 46.05417324177818,
"lng": 5.009765625000001,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 45.537136680398596,
"lng": 7.448730468750001,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 45.54867850352087,
"lng": 10.678710937500002,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
}
],
"created_at": "2026-03-29T10:54:18.332527",
"visibility": "public",
"shared_read": [],
"shared_edit": [],
"comments": [
{
"id": 1774774657963,
"author_id": 1,
"author_name": "josh",
"text": "test",
"created_at": "2026-03-29T10:57:37.963970"
}
]
},
{
"id": 3,
"owner_id": 1,
"title": "now",
"description": "sdagfaedg",
"markers": [
{
"lat": 46.90149244734082,
"lng": 8.014526367187502,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 47.74301740912185,
"lng": 7.053222656250001,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 48.16957199683723,
"lng": 4.155194781488741,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
},
{
"lat": 46.924007100770275,
"lng": 3.3398437500000004,
"title": "tiel",
"date": "",
"description": "sagsdagsag",
"videoUrl": ""
},
{
"lat": 46.29001987172955,
"lng": 4.833984375000001,
"title": "New Marker",
"date": "",
"description": "",
"videoUrl": ""
}
],
"created_at": "2026-04-02T14:55:28.356782",
"visibility": "private",
"shared_read": [],
"shared_edit": [],
"comments": []
}
]

View File

@ -1,20 +0,0 @@
[
{
"id": 1,
"username": "josh",
"password_hash": "scrypt:32768:8:1$HA70PiOwbBrIwlDq$2ab80bdc08bb3bb4214258566aded836062323380491a7f4c7f2e67bdccb8686367789f57b3c6c5eb3e2f08c8c07186f47f9c89d1e72179ddd3758b509f23fbe",
"created_at": "2026-03-27T20:32:43.107028"
},
{
"id": 2,
"username": "test1",
"password_hash": "scrypt:32768:8:1$hPfITQadZq8438bv$38262bf82d93c596a82a1b052a4ba72f8d6729b796ca5273faa7dd47b409112959c4501e77922605a1f3a7ef08e68fa545ce03818eb82e6fb2503cc817c43e2a",
"created_at": "2026-03-28T14:13:32.860143"
},
{
"id": 3,
"username": "test2",
"password_hash": "scrypt:32768:8:1$iZJWgiHFhaN845sv$553a61855a32752aaca7f5d9ac200f99f89d215250e561fb3bb52c46b8d8bd96d09a915969c00bd8cfbded78b70740852671dfb84c659203c92982e2708a10f2",
"created_at": "2026-03-29T10:53:39.433798"
}
]