# omerblgn/carrentalfrontend architecture

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

- Interactive diagram: https://gitdiagram.com/omerblgn/carrentalfrontend
- Repository: https://github.com/omerblgn/carrentalfrontend

## Overview

CarRental is an Angular frontend for browsing cars, managing accounts, and completing rentals, with separate administration screens for catalog and role management. The main customer flow is routed to the car catalog, through car details and rental-date validation, then to payment and rental creation. Services call an external API; local storage supplies authentication and user context. Source excerpts show the customer flow and selected service calls; unsampled screens and services are represented only where the routes or source index establish their role.

Main entry points: [`src/app/app.routes.ts`](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/app.routes.ts) (Route table), [`src/app/components/car-detail/car-detail.component.ts`](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/car-detail/car-detail.component.ts) (Car details), [`src/app/components/payment/payment.component.ts`](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/payment/payment.component.ts) (Payment screen), [`src/app/services/user.service.ts`](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/user.service.ts) (User service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["App shell<br/>[app.component.ts]"]
  node_router["Route table<br/>[app.routes.ts]"]
end

subgraph group_catalog["Car discovery"]
  node_catalog["Car catalog<br/>[car.component.ts]"]
  node_filters["Catalog filters"]
  node_details["Car details"]
  node_carapi["Car services<br/>[car.service.ts]"]
  node_imageapi["Car images"]
end

subgraph group_identity["Identity and accounts"]
  node_authui["Login and registration<br/>[login.component.ts]"]
  node_authapi["Authentication service<br/>[auth.service.ts]"]
  node_accounts["Profile and users"]
  node_userservice["User service<br/>[user.service.ts]"]
  node_session[("Local session")]
  node_guards["Route guards"]
end

subgraph group_rental["Rental checkout"]
  node_rental["Rental dates"]
  node_payment["Payment screen"]
  node_rentalservice["Rental service<br/>[rental.service.ts]"]
  node_cards["Saved cards"]
  node_paymentservice["Payment service<br/>[payment.service.ts]"]
end

subgraph group_admin["Administration"]
  node_admin["Admin console"]
end

node_customer(("Customer"))
node_backend{{"Rental API"}}

node_customer -->|"opens routes"| node_router
node_router -.->|"loads shell"| node_app
node_router -->|"routes to"| node_catalog
node_router -->|"routes to"| node_details
node_router -->|"routes to"| node_authui
node_router -->|"routes to"| node_accounts
node_router -->|"routes to"| node_payment
node_router -->|"routes to"| node_admin
node_catalog -->|"uses filters"| node_filters
node_catalog -->|"loads cars"| node_carapi
node_details -->|"loads details"| node_carapi
node_details -->|"loads images"| node_imageapi
node_details -->|"checks availability"| node_rentalservice
node_details -->|"looks up user"| node_userservice
node_details -->|"navigates with rental"| node_payment
node_authui -->|"authenticates"| node_authapi
node_authapi -->|"checks token"| node_session
node_accounts -->|"updates profile"| node_userservice
node_guards -->|"checks session"| node_session
node_guards -->|"checks claims"| node_userservice
node_payment -->|"submits payment"| node_paymentservice
node_payment -->|"creates rental"| node_rentalservice
node_payment -->|"loads or saves cards"| node_cards
node_payment -->|"looks up account"| node_userservice
node_carapi -->|"HTTP requests"| node_backend
node_authapi -->|"HTTP requests"| node_backend
node_userservice -->|"HTTP requests"| node_backend
node_rentalservice -->|"HTTP requests"| node_backend
node_imageapi -->|"HTTP requests"| node_backend
node_cards -.->|"HTTP requests"| node_backend
node_paymentservice -.->|"HTTP requests"| node_backend

click node_app "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/app.component.ts"
click node_router "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/app.routes.ts"
click node_catalog "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/car/car.component.ts"
click node_filters "https://github.com/omerblgn/carrentalfrontend/tree/master/src/app/components/filter"
click node_details "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/car-detail/car-detail.component.ts"
click node_carapi "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/car.service.ts"
click node_imageapi "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/car-image.service.ts"
click node_authui "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/login/login.component.ts"
click node_authapi "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/auth.service.ts"
click node_accounts "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/profile/profile.component.ts"
click node_userservice "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/user.service.ts"
click node_session "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/local-storage.service.ts"
click node_guards "https://github.com/omerblgn/carrentalfrontend/tree/master/src/app/guards"
click node_rental "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/datepicker/datepicker.component.ts"
click node_payment "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/payment/payment.component.ts"
click node_rentalservice "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/rental.service.ts"
click node_cards "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/credit-card.service.ts"
click node_paymentservice "https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/payment.service.ts"
click node_admin "https://github.com/omerblgn/carrentalfrontend/tree/master/src/app/components/admin"

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_router toneBlue
class node_catalog,node_filters,node_details,node_carapi,node_imageapi toneAmber
class node_authui,node_authapi,node_accounts,node_userservice,node_session,node_guards,node_backend toneMint
class node_rental,node_payment,node_rentalservice,node_cards,node_paymentservice toneRose
class node_admin,node_customer toneIndigo
```

## Components

### Application shell

- [App shell](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/app.component.ts): `src/app/app.component.ts`
- [Route table](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/app.routes.ts): `src/app/app.routes.ts`

### Car discovery

- [Car catalog](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/car/car.component.ts): `src/app/components/car/car.component.ts`
- [Catalog filters](https://github.com/omerblgn/carrentalfrontend/tree/master/src/app/components/filter): `src/app/components/filter`
- [Car details](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/car-detail/car-detail.component.ts): `src/app/components/car-detail/car-detail.component.ts`
- [Car services](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/car.service.ts): `src/app/services/car.service.ts`
- [Car images](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/car-image.service.ts): `src/app/services/car-image.service.ts`

### Identity and accounts

- [Login and registration](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/login/login.component.ts): `src/app/components/login/login.component.ts`
- [Authentication service](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/auth.service.ts): `src/app/services/auth.service.ts`
- [Profile and users](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/profile/profile.component.ts): `src/app/components/profile/profile.component.ts`
- [User service](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/user.service.ts): `src/app/services/user.service.ts`
- [Local session](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/local-storage.service.ts): `src/app/services/local-storage.service.ts`
- [Route guards](https://github.com/omerblgn/carrentalfrontend/tree/master/src/app/guards): `src/app/guards`

### Rental checkout

- [Rental dates](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/datepicker/datepicker.component.ts): `src/app/components/datepicker/datepicker.component.ts`
- [Payment screen](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/components/payment/payment.component.ts): `src/app/components/payment/payment.component.ts`
- [Rental service](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/rental.service.ts): `src/app/services/rental.service.ts`
- [Saved cards](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/credit-card.service.ts): `src/app/services/credit-card.service.ts`
- [Payment service](https://github.com/omerblgn/carrentalfrontend/blob/master/src/app/services/payment.service.ts): `src/app/services/payment.service.ts`

### Administration

- [Admin console](https://github.com/omerblgn/carrentalfrontend/tree/master/src/app/components/admin): `src/app/components/admin`

### Other components

- **Customer**
- **Rental API**

## Connections

- Customer → Route table: opens routes (evidence: `src/app/app.routes.ts`)
- Route table → App shell: loads shell
- Route table → Car catalog: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Car details: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Login and registration: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Profile and users: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Payment screen: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Admin console: routes to (evidence: `src/app/app.routes.ts`)
- Car catalog → Catalog filters: uses filters (evidence: `src/app/components/car/car.component.ts`)
- Car catalog → Car services: loads cars (evidence: `src/app/components/car/car.component.ts`)
- Car details → Car services: loads details (evidence: `src/app/components/car-detail/car-detail.component.ts`)
- Car details → Car images: loads images (evidence: `src/app/components/car-detail/car-detail.component.ts`)
- Car details → Rental service: checks availability (evidence: `src/app/components/car-detail/car-detail.component.ts`)
- Car details → User service: looks up user (evidence: `src/app/components/car-detail/car-detail.component.ts`)
- Car details → Payment screen: navigates with rental (evidence: `src/app/components/car-detail/car-detail.component.ts`)
- Login and registration → Authentication service: authenticates (evidence: `src/app/services/auth.service.ts`)
- Authentication service → Local session: checks token (evidence: `src/app/services/auth.service.ts`)
- Profile and users → User service: updates profile (evidence: `src/app/services/user.service.ts`)
- Route guards → Local session: checks session (evidence: `src/app/guards/admin.guard.ts`)
- Route guards → User service: checks claims (evidence: `src/app/guards/admin.guard.ts`)
- Payment screen → Payment service: submits payment (evidence: `src/app/components/payment/payment.component.ts`)
- Payment screen → Rental service: creates rental (evidence: `src/app/components/payment/payment.component.ts`)
- Payment screen → Saved cards: loads or saves cards (evidence: `src/app/components/payment/payment.component.ts`)
- Payment screen → User service: looks up account (evidence: `src/app/components/payment/payment.component.ts`)
- Car services → Rental API: HTTP requests (evidence: `src/app/services/car.service.ts`)
- Authentication service → Rental API: HTTP requests (evidence: `src/app/services/auth.service.ts`)
- User service → Rental API: HTTP requests (evidence: `src/app/services/user.service.ts`)
- Rental service → Rental API: HTTP requests (evidence: `src/app/services/rental.service.ts`)
- Car images → Rental API: HTTP requests (evidence: `src/app/services/car-image.service.ts`)
- Saved cards → Rental API: HTTP requests
- Payment service → Rental API: HTTP requests
