# baltazardostatny/sprint-5-backend architecture

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

- Interactive diagram: https://gitdiagram.com/baltazardostatny/sprint-5-backend
- Repository: https://github.com/baltazardostatny/sprint-5-backend

## Overview

SafeCo’s checked-in product is a React/TypeScript administration frontend for company users, places, and access checks. The main workflow routes a visitor through login, then to user and place administration or access validation; page-level hooks coordinate API calls and UI state. User management also supports PDF downloads, badges, and profile-image uploads. The README describes JWT authentication and permission enforcement as backend requirements, but this tree contains no backend implementation. Edges are limited to relationships shown in sampled source or the source index.

Main entry points: [`Frontend/src/App.tsx`](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/App.tsx) (Route application), [`Frontend/src/pages/UserList/UserList.tsx`](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/UserList.tsx) (User list page), [`Frontend/src/pages/PlacesList/PlaceList.tsx`](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/PlaceList.tsx) (Places page), [`Frontend/src/pages/UserList/components/CreateUserModal/useCreateUserModal.tsx`](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/components/CreateUserModal/useCreateUserModal.tsx) (User create/edit forms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Routing and shell"]
  node_app["Route application<br/>[App.tsx]"]
  node_auth["Login state<br/>[useAuth.ts]"]
  node_login["Login page<br/>[LoginPage.tsx]"]
  node_shell["Page shell<br/>[PageWrapper.tsx]"]
end

subgraph group_users["User administration"]
  node_users["User list page<br/>[UserList.tsx]"]
  node_userstate["User list state<br/>[useUserList.ts]"]
  node_userforms["User create/edit forms"]
  node_usertable["Users table<br/>[UsersTable.tsx]"]
  node_modal["Modal component<br/>[Modal.tsx]"]
  node_report["PDF report download<br/>[useUserAPI.ts]"]
end

subgraph group_places["Places and access"]
  node_places["Places page<br/>[PlaceList.tsx]"]
  node_placestate["Places state<br/>[usePlaceList.ts]"]
  node_placeforms["Place forms"]
  node_placetable["Places table<br/>[PlacesTable.tsx]"]
  node_access["Access check page<br/>[AllowAcess.tsx]"]
end

subgraph group_integration["API and media integration"]
  node_userapi["User API client<br/>[useUserAPI.ts]"]
  node_placeapi["Place API client<br/>[usePlaceAPI.ts]"]
  node_image["Image resizing<br/>[useImage.ts]"]
  node_upload["S3 upload client<br/>[useAWSAPI.ts]"]
end

node_visitor(("Visitor"))
node_api{{"HTTP API"}}
node_s3[("S3 storage")]

node_visitor -->|"opens"| node_app
node_app -->|"checks state"| node_auth
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_users
node_app -->|"routes to"| node_places
node_app -->|"routes to"| node_access
node_login -->|"submits credentials"| node_userapi
node_login -->|"sets login state"| node_auth
node_users -->|"renders"| node_shell
node_users -->|"uses state"| node_userstate
node_users -->|"renders"| node_usertable
node_users -->|"renders"| node_userforms
node_userstate -->|"calls"| node_userapi
node_userforms -->|"uses"| node_modal
node_userforms -->|"resizes images"| node_image
node_userforms -->|"uploads images"| node_upload
node_users -->|"requests report"| node_report
node_userapi -->|"HTTP requests"| node_api
node_places -->|"renders"| node_shell
node_places -->|"uses state"| node_placestate
node_places -->|"renders"| node_placetable
node_places -->|"renders"| node_placeforms
node_placestate -->|"calls"| node_placeapi
node_placeforms -->|"calls"| node_placeapi
node_access -->|"renders"| node_shell
node_access -->|"checks places"| node_placeapi
node_access -->|"loads users"| node_userapi
node_placeapi -->|"HTTP requests"| node_api
node_upload -->|"gets upload URL"| node_api
node_upload -->|"uploads file"| node_s3

click node_app "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/App.tsx"
click node_auth "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useAuth.ts"
click node_login "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/LoginPage/LoginPage.tsx"
click node_shell "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/components/PageWrapper.tsx"
click node_users "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/UserList.tsx"
click node_userstate "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/useUserList.ts"
click node_userforms "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/components/CreateUserModal/useCreateUserModal.tsx"
click node_usertable "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/components/UsersTable.tsx"
click node_modal "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/components/Modal.tsx"
click node_report "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useUserAPI.ts"
click node_places "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/PlaceList.tsx"
click node_placestate "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/usePlaceList.ts"
click node_placeforms "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/components/CreatePlaceModal/CreatePlaceModal.tsx"
click node_placetable "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/components/PlacesTable.tsx"
click node_access "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/AllowAcess/AllowAcess.tsx"
click node_userapi "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useUserAPI.ts"
click node_placeapi "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/usePlaceAPI.ts"
click node_image "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useImage.ts"
click node_upload "https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useAWSAPI.ts"

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_auth,node_login,node_shell toneBlue
class node_users,node_userstate,node_userforms,node_usertable,node_modal,node_report,node_s3 toneAmber
class node_places,node_placestate,node_placeforms,node_placetable,node_access,node_api toneMint
class node_userapi,node_placeapi,node_image,node_upload toneRose
class node_visitor toneIndigo
```

## Components

### Routing and shell

- [Route application](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/App.tsx): `Frontend/src/App.tsx`
- [Login state](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useAuth.ts): `Frontend/src/hooks/useAuth.ts`
- [Login page](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/LoginPage/LoginPage.tsx): `Frontend/src/pages/LoginPage/LoginPage.tsx`
- [Page shell](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/components/PageWrapper.tsx): `Frontend/src/components/PageWrapper.tsx`

### User administration

- [User list page](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/UserList.tsx): `Frontend/src/pages/UserList/UserList.tsx`
- [User list state](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/useUserList.ts): `Frontend/src/pages/UserList/useUserList.ts`
- [User create/edit forms](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/components/CreateUserModal/useCreateUserModal.tsx): `Frontend/src/pages/UserList/components/CreateUserModal/useCreateUserModal.tsx`
- [Users table](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/UserList/components/UsersTable.tsx): `Frontend/src/pages/UserList/components/UsersTable.tsx`
- [Modal component](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/components/Modal.tsx): `Frontend/src/components/Modal.tsx`
- [PDF report download](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useUserAPI.ts): `Frontend/src/hooks/useUserAPI.ts`

### Places and access

- [Places page](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/PlaceList.tsx): `Frontend/src/pages/PlacesList/PlaceList.tsx`
- [Places state](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/usePlaceList.ts): `Frontend/src/pages/PlacesList/usePlaceList.ts`
- [Place forms](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/components/CreatePlaceModal/CreatePlaceModal.tsx): `Frontend/src/pages/PlacesList/components/CreatePlaceModal/CreatePlaceModal.tsx`
- [Places table](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/PlacesList/components/PlacesTable.tsx): `Frontend/src/pages/PlacesList/components/PlacesTable.tsx`
- [Access check page](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/pages/AllowAcess/AllowAcess.tsx): `Frontend/src/pages/AllowAcess/AllowAcess.tsx`

### API and media integration

- [User API client](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useUserAPI.ts): `Frontend/src/hooks/useUserAPI.ts`
- [Place API client](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/usePlaceAPI.ts): `Frontend/src/hooks/usePlaceAPI.ts`
- [Image resizing](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useImage.ts): `Frontend/src/hooks/useImage.ts`
- [S3 upload client](https://github.com/baltazardostatny/sprint-5-backend/blob/main/Frontend/src/hooks/useAWSAPI.ts): `Frontend/src/hooks/useAWSAPI.ts`

### Other components

- **Visitor**
- **HTTP API**
- **S3 storage**

## Connections

- Visitor → Route application: opens
- Route application → Login state: checks state (evidence: `Frontend/src/App.tsx`)
- Route application → Login page: routes to (evidence: `Frontend/src/App.tsx`)
- Route application → User list page: routes to (evidence: `Frontend/src/App.tsx`)
- Route application → Places page: routes to (evidence: `Frontend/src/App.tsx`)
- Route application → Access check page: routes to (evidence: `Frontend/src/App.tsx`)
- Login page → User API client: submits credentials (evidence: `Frontend/src/pages/LoginPage/LoginPage.tsx`)
- Login page → Login state: sets login state (evidence: `Frontend/src/App.tsx`)
- User list page → Page shell: renders (evidence: `Frontend/src/pages/UserList/UserList.tsx`)
- User list page → User list state: uses state (evidence: `Frontend/src/pages/UserList/UserList.tsx`)
- User list page → Users table: renders (evidence: `Frontend/src/pages/UserList/UserList.tsx`)
- User list page → User create/edit forms: renders (evidence: `Frontend/src/pages/UserList/UserList.tsx`)
- User list state → User API client: calls (evidence: `Frontend/src/pages/UserList/useUserList.ts`)
- User create/edit forms → Modal component: uses (evidence: `Frontend/src/pages/UserList/components/CreateUserModal/CreateUserModal.tsx`)
- User create/edit forms → Image resizing: resizes images (evidence: `Frontend/src/pages/UserList/components/CreateUserModal/useCreateUserModal.tsx`)
- User create/edit forms → S3 upload client: uploads images (evidence: `Frontend/src/pages/UserList/components/CreateUserModal/useCreateUserModal.tsx`)
- User list page → PDF report download: requests report (evidence: `Frontend/src/pages/UserList/UserList.tsx`)
- User API client → HTTP API: HTTP requests (evidence: `Frontend/src/hooks/useUserAPI.ts`)
- Places page → Page shell: renders (evidence: `Frontend/src/pages/PlacesList/PlaceList.tsx`)
- Places page → Places state: uses state (evidence: `Frontend/src/pages/PlacesList/PlaceList.tsx`)
- Places page → Places table: renders (evidence: `Frontend/src/pages/PlacesList/PlaceList.tsx`)
- Places page → Place forms: renders (evidence: `Frontend/src/pages/PlacesList/PlaceList.tsx`)
- Places state → Place API client: calls (evidence: `Frontend/src/pages/PlacesList/usePlaceList.ts`)
- Place forms → Place API client: calls (evidence: `Frontend/src/pages/PlacesList/components/CreatePlaceModal/CreatePlaceModal.tsx`)
- Access check page → Page shell: renders (evidence: `Frontend/src/pages/AllowAcess/AllowAcess.tsx`)
- Access check page → Place API client: checks places (evidence: `Frontend/src/pages/AllowAcess/AllowAcess.tsx`)
- Access check page → User API client: loads users (evidence: `Frontend/src/pages/AllowAcess/AllowAcess.tsx`)
- Place API client → HTTP API: HTTP requests (evidence: `Frontend/src/hooks/usePlaceAPI.ts`)
- S3 upload client → HTTP API: gets upload URL (evidence: `Frontend/src/hooks/useAWSAPI.ts`)
- S3 upload client → S3 storage: uploads file (evidence: `Frontend/src/hooks/useAWSAPI.ts`)
