Dieses Readme ist Teil der App "HabitXP", einer Habit-Tracking-Anwendung mit Gaming Mechanismen.
Members: Dustin, Yassine, Diyar, Kathrin
Go to the project directory
cd backendStart the server
./mvnw spring-boot:runGo to the project directory
cd mobileStart Expo
npx expo start
ODER
npm run webOperating System: Windows
- Java 17+
- Maven
- MongoDB lokal installiert (läuft auf
mongodb://localhost:27017)
- Clone the repository:
$ git clone https://github.com/diyardev001/HabitXP.git- Navigate to the project directory:
$ cd HabitXP- Adjust configuration files:
Modify configuration files (e.g., .env, application.properties) as required.
Für die API-Dokumentation und einfaches Testen verwenden wir Swagger-UI.
- Swagger-UI URL: http://localhost:8080/swagger-ui.html
Hinweis:
- Die API erfordert ansonsten Authentifizierung via JWT.
Mit Swagger kannst du:
- Alle verfügbaren Endpoints einsehen
- API Requests direkt im Browser testen
- Beispiel-Request- und Response-Bodies sehen
Für geschützte Endpunkte ist ein JWT Token erforderlich. Hole dir ein Token über den /auth/login Endpoint.
Die Backend-Struktur basiert auf einem typischen Spring Boot Setup mit klarer Trennung von Verantwortlichkeiten:
backend/
├── .mvn/ # Maven Wrapper Dateien
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com.habitxp.backend/
│ │ │ ├── controller/ # REST Controller (Auth, User)
│ │ │ ├── dto/ # Daten-Transfer-Objekte (LoginRequest, RegisterRequest, AuthResponse)
│ │ │ ├── model/ # Datenmodelle (z.B. User)
│ │ │ ├── repository/ # JPA/Mongo Repositories
│ │ │ ├── security/ # JWT Konfiguration & Filter
│ │ │ ├── service/ # Business-Logik (z.B. AuthService)
│ │ │ └── BackendApplication.java # Main-Klasse
│ │ └── resources/
│ │ ├── static/ # Statische Ressourcen (z.B. Bilder, JS)
│ │ ├── templates/ # (optional) HTML-Templates
│ │ └── application.properties # Konfigurationsdatei
│
├── test/ # Testklassen
├── mvnw / mvnw.cmd # Maven Wrapper
├── .gitignore
├── README.md
└── HELP.mdDas mobile Frontend basiert auf Expo und folgt einer modularen Projektstruktur:
mobile/
├── .expo/ # Expo spezifische Cache-Daten
├── app/ # App Entry-Point und Routing
│ ├── (tabs)/ # Tab-Navigation
│ │ ├── _layout.tsx # Hauptlayout für Tabs
│ │ └── index.tsx # Startseite (z.B. Dashboard)
│
├── assets/ # Bilder, Fonts, etc.
├── components/ # Wiederverwendbare UI-Komponenten
├── node_modules/ # Abhängigkeiten
├── app.json # Expo Konfiguration
├── expo-env.d.ts # TypeScript Setup für Expo-Module
├── package.json # Projektabhängigkeiten & Skripte
├── tsconfig.json # TypeScript Konfiguration
├── .gitignore
└── README.md