# gatlat97/student-housing-db architecture

> Architecture diagram of the GitHub repository gatlat97/student-housing-db, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gatlat97/student-housing-db
- Repository: https://github.com/gatlat97/student-housing-db

## Overview

This PHP/MySQL student-housing application lets students browse rental listings, maintain student profiles and housing preferences, and search for compatible roommates. The main user journey starts at the home page, which links to housing, roommate search, and profile pages; those pages query or update MySQL and render results. A separate importer loads CSV datasets into the database. The excerpts support these page-to-database interactions, but do not establish how listing add/remove pages are reached or fully describe the schema.

Main entry points: [`webpages/index.php`](https://github.com/gatlat97/student-housing-db/blob/main/webpages/index.php) (Home navigation), [`webpages/profile.php`](https://github.com/gatlat97/student-housing-db/blob/main/webpages/profile.php) (Student profile), [`webpages/roommates.php`](https://github.com/gatlat97/student-housing-db/blob/main/webpages/roommates.php) (Roommate search), [`webpages/housing.php`](https://github.com/gatlat97/student-housing-db/blob/main/webpages/housing.php) (Housing search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_home["Home navigation<br/>[index.php]"]
end

subgraph group_student["Student features"]
  node_profile["Student profile<br/>[profile.php]"]
  node_roommates["Roommate search<br/>[roommates.php]"]
end

subgraph group_housing["Housing listings"]
  node_housing_search["Housing search<br/>[housing.php]"]
  node_listing_add["Add listing<br/>[add_housing.php]"]
  node_listing_remove["Remove listing<br/>[remove.php]"]
end

subgraph group_data["Data management"]
  node_csv_data["CSV datasets"]
  node_importer["CSV importer<br/>[import.php]"]
  node_schema["Database schema<br/>[schema.sql]"]
end

node_visitor(("Student"))
node_mysql[("MySQL database")]

node_visitor -->|"opens"| node_home
node_home -->|"links to"| node_housing_search
node_home -->|"links to"| node_roommates
node_home -->|"links to"| node_profile
node_housing_search -->|"queries listings"| node_mysql
node_profile -->|"reads and updates"| node_mysql
node_roommates -->|"searches and updates"| node_mysql
node_listing_add -->|"inserts listing"| node_mysql
node_listing_remove -->|"deletes listing"| node_mysql
node_csv_data -->|"provides CSV files"| node_importer
node_importer -->|"imports rows"| node_mysql

click node_home "https://github.com/gatlat97/student-housing-db/blob/main/webpages/index.php"
click node_profile "https://github.com/gatlat97/student-housing-db/blob/main/webpages/profile.php"
click node_roommates "https://github.com/gatlat97/student-housing-db/blob/main/webpages/roommates.php"
click node_housing_search "https://github.com/gatlat97/student-housing-db/blob/main/webpages/housing.php"
click node_listing_add "https://github.com/gatlat97/student-housing-db/blob/main/webpages/add_housing.php"
click node_listing_remove "https://github.com/gatlat97/student-housing-db/blob/main/webpages/remove.php"
click node_csv_data "https://github.com/gatlat97/student-housing-db/tree/main/database"
click node_importer "https://github.com/gatlat97/student-housing-db/blob/main/database/import.php"
click node_schema "https://github.com/gatlat97/student-housing-db/blob/main/database/schema.sql"

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_home toneBlue
class node_profile,node_roommates,node_mysql toneAmber
class node_housing_search,node_listing_add,node_listing_remove toneMint
class node_csv_data,node_importer,node_schema toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Home navigation](https://github.com/gatlat97/student-housing-db/blob/main/webpages/index.php): `webpages/index.php`

### Student features

- [Student profile](https://github.com/gatlat97/student-housing-db/blob/main/webpages/profile.php): `webpages/profile.php`
- [Roommate search](https://github.com/gatlat97/student-housing-db/blob/main/webpages/roommates.php): `webpages/roommates.php`

### Housing listings

- [Housing search](https://github.com/gatlat97/student-housing-db/blob/main/webpages/housing.php): `webpages/housing.php`
- [Add listing](https://github.com/gatlat97/student-housing-db/blob/main/webpages/add_housing.php): `webpages/add_housing.php`
- [Remove listing](https://github.com/gatlat97/student-housing-db/blob/main/webpages/remove.php): `webpages/remove.php`

### Data management

- [CSV datasets](https://github.com/gatlat97/student-housing-db/tree/main/database): `database`
- [CSV importer](https://github.com/gatlat97/student-housing-db/blob/main/database/import.php): `database/import.php`
- [Database schema](https://github.com/gatlat97/student-housing-db/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Student**
- **MySQL database**

## Connections

- Student → Home navigation: opens (evidence: `README.md`)
- Home navigation → Housing search: links to (evidence: `webpages/index.php`)
- Home navigation → Roommate search: links to (evidence: `webpages/index.php`)
- Home navigation → Student profile: links to (evidence: `webpages/index.php`)
- Housing search → MySQL database: queries listings (evidence: `webpages/housing.php`)
- Student profile → MySQL database: reads and updates (evidence: `webpages/profile.php`)
- Roommate search → MySQL database: searches and updates (evidence: `webpages/roommates.php`)
- Add listing → MySQL database: inserts listing (evidence: `webpages/add_housing.php`)
- Remove listing → MySQL database: deletes listing (evidence: `webpages/remove.php`)
- CSV datasets → CSV importer: provides CSV files (evidence: `database/import.php`)
- CSV importer → MySQL database: imports rows (evidence: `database/import.php`)
