# ahmedlahouel/logement-etudiant architecture

> Architecture diagram of the GitHub repository ahmedlahouel/logement-etudiant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ahmedlahouel/logement-etudiant
- Repository: https://github.com/ahmedlahouel/logement-etudiant

## Overview

Logement Étudiant is a Flutter app for browsing, filtering, favoriting, and publishing student-housing listings in Bizerte, backed by a Spring Boot REST API. The main flow is browse/search listings → inspect or favorite a listing, or submit one → return to the refreshed list; users can also manage locally published listings. The README documents capabilities beyond the sampled frontend source, so those links cite the README. Backend links are grounded in excerpts or the source index; frontend implementation details were not sampled.

Main entry points: [`front/lib/screens/accueil_screen.dart`](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/accueil_screen.dart) (Browse listings), [`backend/src/main/java/tn/iset/backendlog/repositories/AnnonceRepository.java`](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/repositories/AnnonceRepository.java) (Listing repository), [`front/lib/services/annonce_service.dart`](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/services/annonce_service.dart) (Listing service), [`front/lib/providers/favoris_provider.dart`](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/providers/favoris_provider.dart) (Favorite state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Flutter app"]
  node_app["App entry<br/>[main.dart]"]
  node_model["Listing model<br/>[annonce.dart]"]
  node_service["Listing service"]
end

subgraph group_listing["Listing experience"]
  node_home["Browse listings"]
  node_detail["Listing detail<br/>[detail_screen.dart]"]
  node_publish["Publish listing"]
  node_mylistings["My listings"]
  node_favorites["Favorites screen"]
  node_filters["Search and filters"]
  node_listingwidgets["Listing widgets"]
end

subgraph group_local["Local state"]
  node_favstate["Favorite state"]
  node_localprefs[("Local preferences")]
  node_myliststate["Published-listing state"]
end

subgraph group_api["REST backend"]
  node_api["Listings API"]
end

subgraph group_persistence["Persistence"]
  node_repo["Listing repository"]
  node_entity["Listing entity<br/>[Annonce.java]"]
  node_seed["Initial listings<br/>[DataSeeder.java]"]
  node_db[("H2 database")]
  node_userentity["User entity<br/>[User.java]"]
  node_userrepo["User repository"]
end

node_student(("Student"))

node_student -->|"opens"| node_app
node_app -->|"shows"| node_home
node_home -->|"filters"| node_filters
node_home -->|"opens listing"| node_detail
node_home -->|"opens"| node_favorites
node_home -->|"opens"| node_publish
node_home -->|"opens"| node_mylistings
node_home -->|"loads listings"| node_service
node_publish -->|"submits listing"| node_service
node_publish -->|"returns listing"| node_home
node_home -.->|"renders"| node_listingwidgets
node_detail -.->|"renders"| node_listingwidgets
node_home -->|"reads favorites"| node_favstate
node_detail -->|"updates favorites"| node_favstate
node_favorites -->|"reads favorites"| node_favstate
node_favstate -->|"persists"| node_localprefs
node_mylistings -->|"persists listings"| node_localprefs
node_mylistings -->|"deletes listing"| node_service
node_service -->|"HTTP requests"| node_api
node_api -->|"calls"| node_repo
node_repo -->|"stores"| node_entity
node_seed -->|"seeds listings"| node_repo
node_repo -.->|"persists"| node_db
node_entity -->|"references owner"| node_userentity

click node_app "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/main.dart"
click node_home "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/accueil_screen.dart"
click node_detail "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/detail_screen.dart"
click node_publish "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/publier_screen.dart"
click node_mylistings "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/mes_annonces_screen.dart"
click node_favorites "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/favoris_screen.dart"
click node_filters "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/accueil_screen.dart"
click node_listingwidgets "https://github.com/ahmedlahouel/logement-etudiant/tree/main/front/lib/widgets"
click node_model "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/models/annonce.dart"
click node_service "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/services/annonce_service.dart"
click node_favstate "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/providers/favoris_provider.dart"
click node_localprefs "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/providers/favoris_provider.dart"
click node_myliststate "https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/mes_annonces_screen.dart"
click node_api "https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/controller/AnnonceController.java"
click node_repo "https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/repositories/AnnonceRepository.java"
click node_entity "https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/entities/Annonce.java"
click node_seed "https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/config/DataSeeder.java"
click node_db "https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/resources/application.properties"
click node_userentity "https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/entities/User.java"
click node_userrepo "https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/repositories/UserRepository.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_model,node_service toneBlue
class node_home,node_detail,node_publish,node_mylistings,node_favorites,node_filters,node_listingwidgets toneAmber
class node_favstate,node_localprefs,node_myliststate toneMint
class node_api toneRose
class node_repo,node_entity,node_seed,node_db,node_userentity,node_userrepo,node_student toneIndigo
```

## Components

### Flutter app

- [App entry](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/main.dart): `front/lib/main.dart`
- [Listing model](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/models/annonce.dart): `front/lib/models/annonce.dart`
- [Listing service](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/services/annonce_service.dart): `front/lib/services/annonce_service.dart`

### Listing experience

- [Browse listings](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/accueil_screen.dart): `front/lib/screens/accueil_screen.dart`
- [Listing detail](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/detail_screen.dart): `front/lib/screens/detail_screen.dart`
- [Publish listing](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/publier_screen.dart): `front/lib/screens/publier_screen.dart`
- [My listings](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/mes_annonces_screen.dart): `front/lib/screens/mes_annonces_screen.dart`
- [Favorites screen](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/favoris_screen.dart): `front/lib/screens/favoris_screen.dart`
- [Search and filters](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/accueil_screen.dart): `front/lib/screens/accueil_screen.dart`
- [Listing widgets](https://github.com/ahmedlahouel/logement-etudiant/tree/main/front/lib/widgets): `front/lib/widgets`

### Local state

- [Favorite state](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/providers/favoris_provider.dart): `front/lib/providers/favoris_provider.dart`
- [Local preferences](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/providers/favoris_provider.dart): `front/lib/providers/favoris_provider.dart`
- [Published-listing state](https://github.com/ahmedlahouel/logement-etudiant/blob/main/front/lib/screens/mes_annonces_screen.dart): `front/lib/screens/mes_annonces_screen.dart`

### REST backend

- [Listings API](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/controller/AnnonceController.java): `backend/src/main/java/tn/iset/backendlog/controller/AnnonceController.java`

### Persistence

- [Listing repository](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/repositories/AnnonceRepository.java): `backend/src/main/java/tn/iset/backendlog/repositories/AnnonceRepository.java`
- [Listing entity](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/entities/Annonce.java): `backend/src/main/java/tn/iset/backendlog/entities/Annonce.java`
- [Initial listings](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/config/DataSeeder.java): `backend/src/main/java/tn/iset/backendlog/config/DataSeeder.java`
- [H2 database](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/resources/application.properties): `backend/src/main/resources/application.properties`
- [User entity](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/entities/User.java): `backend/src/main/java/tn/iset/backendlog/entities/User.java`
- [User repository](https://github.com/ahmedlahouel/logement-etudiant/blob/main/backend/src/main/java/tn/iset/backendlog/repositories/UserRepository.java): `backend/src/main/java/tn/iset/backendlog/repositories/UserRepository.java`

### Other components

- **Student**

## Connections

- Student → App entry: opens (evidence: `README.md`)
- App entry → Browse listings: shows (evidence: `README.md`)
- Browse listings → Search and filters: filters (evidence: `README.md`)
- Browse listings → Listing detail: opens listing (evidence: `README.md`)
- Browse listings → Favorites screen: opens (evidence: `README.md`)
- Browse listings → Publish listing: opens (evidence: `README.md`)
- Browse listings → My listings: opens (evidence: `README.md`)
- Browse listings → Listing service: loads listings (evidence: `README.md`)
- Publish listing → Listing service: submits listing (evidence: `README.md`)
- Publish listing → Browse listings: returns listing (evidence: `README.md`)
- Browse listings → Listing widgets: renders
- Listing detail → Listing widgets: renders
- Browse listings → Favorite state: reads favorites (evidence: `README.md`)
- Listing detail → Favorite state: updates favorites (evidence: `README.md`)
- Favorites screen → Favorite state: reads favorites (evidence: `README.md`)
- Favorite state → Local preferences: persists (evidence: `README.md`)
- My listings → Local preferences: persists listings (evidence: `README.md`)
- My listings → Listing service: deletes listing (evidence: `README.md`)
- Listing service → Listings API: HTTP requests (evidence: `README.md`)
- Listings API → Listing repository: calls (evidence: `backend/src/main/java/tn/iset/backendlog/controller/AnnonceController.java`)
- Listing repository → Listing entity: stores (evidence: `backend/src/main/java/tn/iset/backendlog/repositories/AnnonceRepository.java`)
- Initial listings → Listing repository: seeds listings (evidence: `backend/src/main/java/tn/iset/backendlog/config/DataSeeder.java`)
- Listing repository → H2 database: persists
- Listing entity → User entity: references owner (evidence: `backend/src/main/java/tn/iset/backendlog/entities/Annonce.java`)
