# vipsibi/hotel-list-crud-application architecture

> Architecture diagram of the GitHub repository vipsibi/hotel-list-crud-application, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vipsibi/hotel-list-crud-application
- Repository: https://github.com/vipsibi/hotel-list-crud-application

## Overview

ERAMIKA is a hotel discovery and management application. Visitors browse featured stays or search and filter the hotel catalog, then view hotel details and locations on a map; managers can add, edit, and delete hotel records. The frontend routes pages through shared Redux hotel state and an API service, with a mock-data implementation available. The backend initializes a PostgreSQL hotel table and seed records. Backend route behavior and the live API transport are not excerpted, so those connections are not asserted as verified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/App.jsx) (Route shell), [`frontend/src/pages/HotelList.jsx`](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/HotelList.jsx) (Hotel catalog), [`frontend/src/features/hotels/hotelSlice.js`](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/features/hotels/hotelSlice.js) (Hotel state and actions), [`frontend/src/components/HotelCard.jsx`](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/HotelCard.jsx) (Hotel card)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["Route shell<br/>[App.jsx]"]
  node_hotel_card["Hotel card<br/>[HotelCard.jsx]"]
  node_hotel_map["Location map<br/>[HotelMap.jsx]"]
  node_pagination["Pagination<br/>[Pagination.jsx]"]
  node_success_modal["Success notice<br/>[SuccessModal.jsx]"]
end

subgraph group_hotel_workflows["Hotel workflows"]
  node_home["Featured stays<br/>[Home.jsx]"]
  node_hotel_list["Hotel catalog<br/>[HotelList.jsx]"]
  node_hotel_form["Hotel editor<br/>[HotelForm.jsx]"]
  node_hotel_detail["Hotel details<br/>[HotelDetail.jsx]"]
end

subgraph group_data_services["Data services"]
  node_hotel_state["Hotel state and actions<br/>[hotelSlice.js]"]
  node_api_service["API service<br/>[api.js]"]
  node_mock_api["Mock API<br/>[mockApi.js]"]
  node_mock_data["Mock hotel data<br/>[mockHotels.js]"]
  node_hotel_slug["Hotel slugs<br/>[hotelSlug.js]"]
  node_image_url["Image URL helper<br/>[imageUrl.js]"]
end

subgraph group_backend["Backend storage"]
  node_backend_server["Backend API server<br/>[server.js]"]
  node_database_init["Hotel database setup<br/>[db.js]"]
end

node_visitor(("Visitor or manager"))
node_postgres[("PostgreSQL")]
node_map_tiles["OpenStreetMap tiles"]

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_hotel_list
node_app -->|"routes to"| node_hotel_form
node_app -->|"routes to"| node_hotel_detail
node_home -->|"dispatches fetch"| node_hotel_state
node_hotel_list -->|"dispatches actions"| node_hotel_state
node_hotel_list -->|"renders"| node_hotel_card
node_hotel_list -->|"renders"| node_pagination
node_hotel_list -->|"renders"| node_success_modal
node_hotel_form -->|"dispatches actions"| node_hotel_state
node_hotel_form -->|"renders"| node_hotel_map
node_hotel_detail -->|"dispatches actions"| node_hotel_state
node_hotel_detail -->|"renders"| node_hotel_map
node_hotel_card -->|"creates links"| node_hotel_slug
node_hotel_card -->|"resolves image"| node_image_url
node_hotel_state -->|"requests data"| node_api_service
node_api_service -.->|"uses mock requests"| node_mock_api
node_mock_api -->|"loads seed data"| node_mock_data
node_mock_api -->|"matches slugs"| node_hotel_slug
node_hotel_map -->|"loads tiles"| node_map_tiles
node_backend_server -->|"uses database setup"| node_database_init
node_database_init -->|"creates and seeds"| node_postgres
node_api_service -.->|"sends API requests"| node_backend_server

click node_app "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/Home.jsx"
click node_hotel_list "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/HotelList.jsx"
click node_hotel_form "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/HotelForm.jsx"
click node_hotel_detail "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/HotelDetail.jsx"
click node_hotel_card "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/HotelCard.jsx"
click node_hotel_map "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/HotelMap.jsx"
click node_pagination "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/Pagination.jsx"
click node_success_modal "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/SuccessModal.jsx"
click node_hotel_state "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/features/hotels/hotelSlice.js"
click node_api_service "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/services/api.js"
click node_mock_api "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/services/mockApi.js"
click node_mock_data "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/app/data/mockHotels.js"
click node_hotel_slug "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/utils/hotelSlug.js"
click node_image_url "https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/services/imageUrl.js"
click node_backend_server "https://github.com/vipsibi/hotel-list-crud-application/blob/main/backend/server.js"
click node_database_init "https://github.com/vipsibi/hotel-list-crud-application/blob/main/backend/db.js"

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_hotel_card,node_hotel_map,node_pagination,node_success_modal toneBlue
class node_home,node_hotel_list,node_hotel_form,node_hotel_detail,node_postgres toneAmber
class node_hotel_state,node_api_service,node_mock_api,node_mock_data,node_hotel_slug,node_image_url toneMint
class node_backend_server,node_database_init toneRose
class node_visitor,node_map_tiles toneIndigo
```

## Components

### Frontend experience

- [Route shell](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Hotel card](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/HotelCard.jsx): `frontend/src/components/HotelCard.jsx`
- [Location map](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/HotelMap.jsx): `frontend/src/components/HotelMap.jsx`
- [Pagination](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/Pagination.jsx): `frontend/src/components/Pagination.jsx`
- [Success notice](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/components/SuccessModal.jsx): `frontend/src/components/SuccessModal.jsx`

### Hotel workflows

- [Featured stays](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Hotel catalog](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/HotelList.jsx): `frontend/src/pages/HotelList.jsx`
- [Hotel editor](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/HotelForm.jsx): `frontend/src/pages/HotelForm.jsx`
- [Hotel details](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/pages/HotelDetail.jsx): `frontend/src/pages/HotelDetail.jsx`

### Data services

- [Hotel state and actions](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/features/hotels/hotelSlice.js): `frontend/src/features/hotels/hotelSlice.js`
- [API service](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Mock API](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/services/mockApi.js): `frontend/src/services/mockApi.js`
- [Mock hotel data](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/app/data/mockHotels.js): `frontend/src/app/data/mockHotels.js`
- [Hotel slugs](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/utils/hotelSlug.js): `frontend/src/utils/hotelSlug.js`
- [Image URL helper](https://github.com/vipsibi/hotel-list-crud-application/blob/main/frontend/src/services/imageUrl.js): `frontend/src/services/imageUrl.js`

### Backend storage

- [Backend API server](https://github.com/vipsibi/hotel-list-crud-application/blob/main/backend/server.js): `backend/server.js`
- [Hotel database setup](https://github.com/vipsibi/hotel-list-crud-application/blob/main/backend/db.js): `backend/db.js`

### Other components

- **Visitor or manager**
- **PostgreSQL**
- **OpenStreetMap tiles**

## Connections

- Visitor or manager → Route shell: opens (evidence: `frontend/src/App.jsx`)
- Route shell → Featured stays: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Hotel catalog: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Hotel editor: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Hotel details: routes to (evidence: `frontend/src/App.jsx`)
- Featured stays → Hotel state and actions: dispatches fetch (evidence: `frontend/src/pages/Home.jsx`)
- Hotel catalog → Hotel state and actions: dispatches actions (evidence: `frontend/src/pages/HotelList.jsx`)
- Hotel catalog → Hotel card: renders (evidence: `frontend/src/pages/HotelList.jsx`)
- Hotel catalog → Pagination: renders (evidence: `frontend/src/pages/HotelList.jsx`)
- Hotel catalog → Success notice: renders (evidence: `frontend/src/pages/HotelList.jsx`)
- Hotel editor → Hotel state and actions: dispatches actions (evidence: `frontend/src/pages/HotelForm.jsx`)
- Hotel editor → Location map: renders (evidence: `frontend/src/pages/HotelForm.jsx`)
- Hotel details → Hotel state and actions: dispatches actions (evidence: `frontend/src/pages/HotelDetail.jsx`)
- Hotel details → Location map: renders (evidence: `frontend/src/pages/HotelDetail.jsx`)
- Hotel card → Hotel slugs: creates links (evidence: `frontend/src/components/HotelCard.jsx`)
- Hotel card → Image URL helper: resolves image (evidence: `frontend/src/components/HotelCard.jsx`)
- Hotel state and actions → API service: requests data (evidence: `frontend/src/features/hotels/hotelSlice.js`)
- API service → Mock API: uses mock requests (evidence: `frontend/src/services/api.js`)
- Mock API → Mock hotel data: loads seed data (evidence: `frontend/src/services/mockApi.js`)
- Mock API → Hotel slugs: matches slugs (evidence: `frontend/src/services/mockApi.js`)
- Location map → OpenStreetMap tiles: loads tiles (evidence: `frontend/src/components/HotelMap.jsx`)
- Backend API server → Hotel database setup: uses database setup (evidence: `backend/server.js`)
- Hotel database setup → PostgreSQL: creates and seeds (evidence: `backend/db.js`)
- API service → Backend API server: sends API requests
