From 083fd94714399aa14a0d394e39ac0f1298e5726b Mon Sep 17 00:00:00 2001 From: inventory69 Date: Fri, 19 Dec 2025 23:44:05 +0100 Subject: [PATCH] Initial commit: Simple Notes Sync project setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Features: - Docker WebDAV server with docker-compose - Server configuration with .env - Project structure for Android app - Complete documentation references - MIT License Server: - bytemark/webdav Docker image - Basic authentication - Port 8080 exposed - Volume mounts for data and logs - Quick start README Android: - Project structure defined - README with setup instructions - Links to complete implementation guide Status: Server running and tested ✓ Next: Android app implementation in Android Studio --- .gitignore | 39 ++++++ LICENSE | 21 ++++ README.md | 246 ++++++++++++++++++++++++++++++++++++++ android/README.md | 120 +++++++++++++++++++ server/.env.example | 6 + server/.gitignore | 9 ++ server/README.md | 63 ++++++++++ server/docker-compose.yml | 22 ++++ 8 files changed, 526 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 android/README.md create mode 100644 server/.env.example create mode 100644 server/.gitignore create mode 100644 server/README.md create mode 100644 server/docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f498879 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Server +server/.env +server/notes-data/ +server/logs/ + +# Android +android/.gradle/ +android/.idea/ +android/local.properties +android/build/ +android/*/build/ +android/.DS_Store +android/captures/ +android/*.apk +android/*.ap_ +android/*.aab + +# Gradle +.gradle +build/ + +# IDE +.idea/ +*.iml +*.ipr +*.iws +.vscode/ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log + +# Temp +*.tmp +*.swp +*~ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..86c0227 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Simple Notes Sync + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fa81780 --- /dev/null +++ b/README.md @@ -0,0 +1,246 @@ +# Simple Notes Sync + +Minimalistische Offline-Notiz-App mit automatischer WLAN-Synchronisierung. + +## 📱 Features + +- ✅ Offline-first: Notizen lokal erstellen und bearbeiten +- ✅ Auto-Sync: Automatische Synchronisierung im Heim-WLAN +- ✅ WebDAV: Docker-basierter Server +- ✅ Simpel: Fokus auf Funktionalität +- ✅ Robust: Fehlerbehandlung und Konfliktauflösung + +## 🏗️ Projekt-Struktur + +``` +simple-notes-sync/ +├── server/ # Docker WebDAV Server +│ ├── docker-compose.yml +│ ├── .env.example +│ └── README.md +│ +└── android/ # Android App (Kotlin) + └── (Android Studio Projekt) +``` + +## 🚀 Quick Start + +### 1. Server starten + +```bash +cd server +cp .env.example .env +nano .env # Passwort anpassen +docker-compose up -d +``` + +### 2. Server testen + +```bash +curl -u noteuser:your_password http://localhost:8080/ +``` + +### 3. Android App entwickeln + +```bash +cd android +# In Android Studio öffnen +# Build & Run +``` + +## 📖 Dokumentation + +Vollständige Dokumentation: [project-docs/simple-notes-sync](https://github.com/inventory69/project-docs/tree/main/simple-notes-sync) + +- [README.md](https://github.com/inventory69/project-docs/blob/main/simple-notes-sync/README.md) - Projekt-Übersicht +- [IMPLEMENTATION_PLAN.md](https://github.com/inventory69/project-docs/blob/main/simple-notes-sync/IMPLEMENTATION_PLAN.md) - Sprint-Plan +- [SERVER_SETUP.md](https://github.com/inventory69/project-docs/blob/main/simple-notes-sync/SERVER_SETUP.md) - Server-Setup +- [ANDROID_GUIDE.md](https://github.com/inventory69/project-docs/blob/main/simple-notes-sync/ANDROID_GUIDE.md) - Android-Entwicklung +- [NOTIFICATIONS.md](https://github.com/inventory69/project-docs/blob/main/simple-notes-sync/NOTIFICATIONS.md) - Notification-System + +## ⚙️ Server Konfiguration + +**Standard-Credentials:** +- Username: `noteuser` +- Password: Siehe `.env` im `server/` Verzeichnis + +**Server-URL:** +- Lokal: `http://localhost:8080/` +- Im Netzwerk: `http://YOUR_IP:8080/` + +IP-Adresse finden: +```bash +ip addr show | grep "inet " | grep -v 127.0.0.1 +``` + +## 📱 Android App Setup + +### Vorraussetzungen + +- Android Studio Hedgehog (2023.1.1) oder neuer +- JDK 17 +- Min SDK 24 (Android 7.0) +- Target SDK 34 (Android 14) + +### In App konfigurieren + +1. App starten +2. Einstellungen öffnen +3. Server-URL eintragen (z.B. `http://192.168.1.100:8080/`) +4. Username & Passwort eingeben +5. Heim-WLAN SSID eingeben +6. "Verbindung testen" + +## 🔧 Entwicklung + +### Server-Management + +```bash +# Status prüfen +docker-compose ps + +# Logs anschauen +docker-compose logs -f + +# Neustarten +docker-compose restart + +# Stoppen +docker-compose down +``` + +### Android-Build + +```bash +cd android +./gradlew assembleDebug + +# APK Location: +# app/build/outputs/apk/debug/app-debug.apk +``` + +## 🧪 Testing + +### Server-Test + +```bash +# Testdatei hochladen +echo '{"id":"test","title":"Test","content":"Hello"}' > test.json +curl -u noteuser:password -T test.json http://localhost:8080/test.json + +# Datei abrufen +curl -u noteuser:password http://localhost:8080/test.json + +# Datei löschen +curl -u noteuser:password -X DELETE http://localhost:8080/test.json +``` + +### Android-App + +1. Notiz erstellen → speichern → in Liste sichtbar ✓ +2. WLAN verbinden → Auto-Sync ✓ +3. Server offline → Fehlermeldung ✓ +4. Konflikt-Szenario → Auflösung ✓ + +## 📦 Deployment + +### Server (Production) + +**Option 1: Lokaler Server (Raspberry Pi, etc.)** +```bash +docker-compose up -d +``` + +**Option 2: VPS (DigitalOcean, Hetzner, etc.)** +```bash +# Mit HTTPS (empfohlen) +# Zusätzlich: Reverse Proxy (nginx/Caddy) + Let's Encrypt +``` + +### Android App + +```bash +# Release Build +./gradlew assembleRelease + +# APK signieren +# Play Store Upload oder Direct Install +``` + +## 🔐 Security + +**Entwicklung:** +- ✅ HTTP Basic Auth +- ✅ Nur im lokalen Netzwerk + +**Produktion:** +- ⚠️ HTTPS mit SSL/TLS (empfohlen) +- ⚠️ Starkes Passwort +- ⚠️ Firewall-Regeln +- ⚠️ VPN für externen Zugriff + +## 🐛 Troubleshooting + +### Server startet nicht + +```bash +# Port bereits belegt? +sudo netstat -tlnp | grep 8080 + +# Logs checken +docker-compose logs webdav +``` + +### Android kann nicht verbinden + +- Ist Android im gleichen WLAN? +- Ist die Server-IP korrekt? +- Firewall blockiert Port 8080? +- Credentials korrekt? + +```bash +# Ping zum Server +ping YOUR_SERVER_IP + +# Port erreichbar? +telnet YOUR_SERVER_IP 8080 +``` + +## 📝 TODO / Roadmap + +### Version 1.0 (MVP) +- [x] Docker WebDAV Server +- [ ] Android Basic CRUD +- [ ] Auto-Sync bei WLAN +- [ ] Error Handling +- [ ] Notifications + +### Version 1.1 +- [ ] Suche +- [ ] Dark Mode +- [ ] Markdown-Support + +### Version 2.0 +- [ ] Desktop-Client (Flutter Desktop) +- [ ] Tags/Kategorien +- [ ] Verschlüsselung +- [ ] Shared Notes + +## 📄 License + +MIT License - siehe [LICENSE](LICENSE) + +## 👤 Author + +Created for personal use - 2025 + +## 🙏 Acknowledgments + +- [bytemark/webdav](https://hub.docker.com/r/bytemark/webdav) - Docker WebDAV Server +- [Sardine Android](https://github.com/thegrizzlylabs/sardine-android) - WebDAV Client +- [Android WorkManager](https://developer.android.com/topic/libraries/architecture/workmanager) - Background Tasks + +--- + +**Project Start:** 19. Dezember 2025 +**Status:** 🚧 In Development diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..aa49b75 --- /dev/null +++ b/android/README.md @@ -0,0 +1,120 @@ +# Simple Notes - Android App + +## 🚧 Development Setup + +### Voraussetzungen + +- Android Studio Hedgehog (2023.1.1) oder neuer +- JDK 17 +- Android SDK 34 +- Min SDK 24 + +### Projekt in Android Studio öffnen + +```bash +# In Android Studio: +# File → New → New Project +# Template: Empty Views Activity +# +# Settings: +# Name: Simple Notes +# Package: com.example.simplenotes +# Save location: /home/liq/gitProjects/simple-notes-sync/android/ +# Language: Kotlin +# Minimum SDK: API 24 +# Build configuration: Kotlin DSL +``` + +### Dependencies + +Siehe `ANDROID_GUIDE.md` in project-docs für vollständige `build.gradle.kts`: + +**Hauptabhängigkeiten:** +- Sardine Android (WebDAV Client) +- Kotlin Coroutines +- Gson (JSON) +- WorkManager (Background Sync) +- Material Design Components + +### Projektstruktur + +``` +android/ +└── app/ + └── src/ + └── main/ + ├── AndroidManifest.xml + ├── java/com/example/simplenotes/ + │ ├── MainActivity.kt + │ ├── NoteEditorActivity.kt + │ ├── SettingsActivity.kt + │ ├── models/ + │ │ ├── Note.kt + │ │ └── SyncStatus.kt + │ ├── storage/ + │ │ └── NotesStorage.kt + │ ├── sync/ + │ │ ├── WebDavSyncService.kt + │ │ ├── WifiSyncReceiver.kt + │ │ ├── SyncWorker.kt + │ │ └── ConflictResolver.kt + │ ├── adapters/ + │ │ └── NotesAdapter.kt + │ └── utils/ + │ ├── DeviceIdGenerator.kt + │ ├── NotificationHelper.kt + │ ├── Extensions.kt + │ └── Constants.kt + └── res/ + ├── layout/ + ├── values/ + └── drawable/ +``` + +## 📖 Development Guide + +Vollständige Code-Beispiele und Implementation: +- [ANDROID_GUIDE.md](https://github.com/inventory69/project-docs/blob/main/simple-notes-sync/ANDROID_GUIDE.md) +- [IMPLEMENTATION_PLAN.md](https://github.com/inventory69/project-docs/blob/main/simple-notes-sync/IMPLEMENTATION_PLAN.md) + +## 🏗️ Build + +```bash +# Debug Build +./gradlew assembleDebug + +# Release Build +./gradlew assembleRelease + +# Install on connected device +./gradlew installDebug +``` + +## 🧪 Testing + +```bash +# Run unit tests +./gradlew test + +# Run instrumented tests +./gradlew connectedAndroidTest +``` + +## 📝 TODO + +- [ ] Projekt in Android Studio erstellen +- [ ] Dependencies einrichten +- [ ] Models implementieren (Note.kt, SyncStatus.kt) +- [ ] Storage Layer (NotesStorage.kt) +- [ ] UI Layouts erstellen +- [ ] Activities implementieren +- [ ] Sync Service (WebDavSyncService.kt) +- [ ] WLAN Detection (WifiSyncReceiver.kt) +- [ ] WorkManager Setup (SyncWorker.kt) +- [ ] Notifications (NotificationHelper.kt) +- [ ] Error Handling +- [ ] Testing + +--- + +**Next Step:** Projekt in Android Studio erstellen und Code aus ANDROID_GUIDE.md übernehmen. diff --git a/server/.env.example b/server/.env.example new file mode 100644 index 0000000..e9c8032 --- /dev/null +++ b/server/.env.example @@ -0,0 +1,6 @@ +# WebDAV Credentials +WEBDAV_USERNAME=noteuser +WEBDAV_PASSWORD=your_secure_password_here + +# Optional: Custom port +# WEBDAV_PORT=8080 diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..af8325f --- /dev/null +++ b/server/.gitignore @@ -0,0 +1,9 @@ +# Environment +.env + +# Data +notes-data/ +logs/ + +# Docker +docker-compose.override.yml diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..4d99a26 --- /dev/null +++ b/server/README.md @@ -0,0 +1,63 @@ +# WebDAV Server - Simple Notes Sync + +## Quick Start + +```bash +# 1. Umgebungsvariablen anpassen +cp .env.example .env +nano .env + +# 2. Server starten +docker-compose up -d + +# 3. Logs prüfen +docker-compose logs -f + +# 4. Testen +curl -u noteuser:your_password http://localhost:8080/ +``` + +## Server URL + +**Lokal:** `http://localhost:8080/` + +**Im Netzwerk:** `http://YOUR_IP:8080/` (z.B. `http://192.168.1.100:8080/`) + +IP-Adresse herausfinden: +```bash +ip addr show | grep "inet " | grep -v 127.0.0.1 +``` + +## Credentials + +Standard (siehe `.env`): +- Username: `noteuser` +- Password: Siehe `.env` Datei + +## Management + +```bash +# Status prüfen +docker-compose ps + +# Logs anschauen +docker-compose logs -f + +# Neustarten +docker-compose restart + +# Stoppen +docker-compose down + +# Komplett löschen (inkl. Daten) +docker-compose down -v +``` + +## Daten + +Notizen werden gespeichert in: `./notes-data/` + +Backup erstellen: +```bash +tar -czf backup-$(date +%Y%m%d).tar.gz notes-data/ +``` diff --git a/server/docker-compose.yml b/server/docker-compose.yml new file mode 100644 index 0000000..3f89158 --- /dev/null +++ b/server/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + webdav: + image: bytemark/webdav + container_name: simple-notes-webdav + restart: unless-stopped + ports: + - "8080:80" + environment: + AUTH_TYPE: Basic + USERNAME: ${WEBDAV_USERNAME} + PASSWORD: ${WEBDAV_PASSWORD} + volumes: + - ./notes-data:/var/lib/dav/data + - ./logs:/var/log/apache2 + networks: + - notes-network + +networks: + notes-network: + driver: bridge