# geoxin3/wayfarer architecture

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

- Interactive diagram: https://gitdiagram.com/geoxin3/wayfarer
- Repository: https://github.com/geoxin3/wayfarer

## Overview

Wayfarer is a trip-planning web application with user registration/login, destination discovery and administration, and trips composed of destinations. The visible flow is browser routes to frontend screens, frontend API helpers to FastAPI routers, and backend services to PostgreSQL-backed models. The sampled source confirms authentication wiring and trip/destination service behavior; router-to-service wiring for destinations and trips, and screen-to-helper usage, is not shown, so those links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/App.jsx) (Route application), [`backend/app/main.py`](https://github.com/geoxin3/wayfarer/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/services/api.js`](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/api.js) (HTTP requests), [`backend/app/services/trip_service.py`](https://github.com/geoxin3/wayfarer/blob/main/backend/app/services/trip_service.py) (Trip service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route application<br/>[App.jsx]"]
  node_auth_pages["Account screens<br/>[Login.jsx]"]
  node_destination_pages["Destination screens<br/>[Destinations.jsx]"]
  node_trip_pages["Trip screens<br/>[PlanTrip.jsx]"]
  node_admin_pages["Admin screens<br/>[AdminHome.jsx]"]
  node_auth_client["Auth API helper<br/>[authService.js]"]
  node_destination_client["Destination API helper"]
  node_trip_client["Trip API helper<br/>[tripService.js]"]
  node_http_client["HTTP requests<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_auth_router["Authentication routes<br/>[auth.py]"]
  node_destination_router["Destination routes<br/>[destination.py]"]
  node_trip_router["Trip routes<br/>[trip.py]"]
end

subgraph group_domain["Domain services"]
  node_auth_service["Account service<br/>[auth_service.py]"]
  node_destination_service["Destination service"]
  node_trip_service["Trip service<br/>[trip_service.py]"]
  node_security["Password security<br/>[security.py]"]
end

subgraph group_persistence["Persistence"]
  node_user_model["User records<br/>[user.py]"]
  node_destination_model["Destination records<br/>[destination.py]"]
  node_trip_model["Trip records<br/>[trip.py]"]
  node_trip_destination_model["Trip-destination links"]
  node_db_session["Database sessions<br/>[database.py]"]
end

node_traveler(("Traveler"))
node_postgres[("PostgreSQL")]

node_traveler -->|"uses"| node_app
node_app -->|"routes to"| node_auth_pages
node_app -->|"routes to"| node_destination_pages
node_app -->|"routes to"| node_trip_pages
node_app -->|"routes to"| node_admin_pages
node_auth_client -->|"requests"| node_http_client
node_destination_client -->|"requests"| node_http_client
node_trip_client -->|"requests"| node_http_client
node_http_client -->|"sends API requests"| node_fastapi
node_fastapi -->|"includes"| node_auth_router
node_fastapi -->|"includes"| node_destination_router
node_fastapi -->|"includes"| node_trip_router
node_auth_router -->|"calls"| node_auth_service
node_auth_router -->|"opens session"| node_db_session
node_auth_service -->|"queries and writes"| node_user_model
node_auth_service -->|"hashes and verifies"| node_security
node_destination_service -->|"queries and writes"| node_destination_model
node_trip_service -->|"queries and writes"| node_trip_model
node_trip_service -->|"checks destination"| node_destination_model
node_trip_service -->|"queries and writes"| node_trip_destination_model
node_db_session -->|"connects"| node_postgres

click node_app "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/App.jsx"
click node_auth_pages "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/pages/Login.jsx"
click node_destination_pages "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/pages/Destinations.jsx"
click node_trip_pages "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/pages/PlanTrip.jsx"
click node_admin_pages "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/admin/AdminHome.jsx"
click node_auth_client "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/authService.js"
click node_destination_client "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/destinationService.js"
click node_trip_client "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/tripService.js"
click node_http_client "https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/api.js"
click node_fastapi "https://github.com/geoxin3/wayfarer/blob/main/backend/app/main.py"
click node_auth_router "https://github.com/geoxin3/wayfarer/blob/main/backend/app/routers/auth.py"
click node_destination_router "https://github.com/geoxin3/wayfarer/blob/main/backend/app/routers/destination.py"
click node_trip_router "https://github.com/geoxin3/wayfarer/blob/main/backend/app/routers/trip.py"
click node_auth_service "https://github.com/geoxin3/wayfarer/blob/main/backend/app/services/auth_service.py"
click node_destination_service "https://github.com/geoxin3/wayfarer/blob/main/backend/app/services/destination_service.py"
click node_trip_service "https://github.com/geoxin3/wayfarer/blob/main/backend/app/services/trip_service.py"
click node_security "https://github.com/geoxin3/wayfarer/blob/main/backend/app/core/security.py"
click node_user_model "https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/user.py"
click node_destination_model "https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/destination.py"
click node_trip_model "https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/trip.py"
click node_trip_destination_model "https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/trip_destination.py"
click node_db_session "https://github.com/geoxin3/wayfarer/blob/main/backend/app/core/database.py"

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_pages,node_destination_pages,node_trip_pages,node_admin_pages,node_auth_client,node_destination_client,node_trip_client,node_http_client toneBlue
class node_fastapi,node_auth_router,node_destination_router,node_trip_router,node_postgres toneAmber
class node_auth_service,node_destination_service,node_trip_service,node_security toneMint
class node_user_model,node_destination_model,node_trip_model,node_trip_destination_model,node_db_session toneRose
class node_traveler toneIndigo
```

## Components

### Web client

- [Route application](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Account screens](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Destination screens](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/pages/Destinations.jsx): `frontend/src/pages/Destinations.jsx`
- [Trip screens](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/pages/PlanTrip.jsx): `frontend/src/pages/PlanTrip.jsx`
- [Admin screens](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/admin/AdminHome.jsx): `frontend/src/admin/AdminHome.jsx`
- [Auth API helper](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Destination API helper](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/destinationService.js): `frontend/src/services/destinationService.js`
- [Trip API helper](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/tripService.js): `frontend/src/services/tripService.js`
- [HTTP requests](https://github.com/geoxin3/wayfarer/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Backend API

- [FastAPI application](https://github.com/geoxin3/wayfarer/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/geoxin3/wayfarer/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Destination routes](https://github.com/geoxin3/wayfarer/blob/main/backend/app/routers/destination.py): `backend/app/routers/destination.py`
- [Trip routes](https://github.com/geoxin3/wayfarer/blob/main/backend/app/routers/trip.py): `backend/app/routers/trip.py`

### Domain services

- [Account service](https://github.com/geoxin3/wayfarer/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Destination service](https://github.com/geoxin3/wayfarer/blob/main/backend/app/services/destination_service.py): `backend/app/services/destination_service.py`
- [Trip service](https://github.com/geoxin3/wayfarer/blob/main/backend/app/services/trip_service.py): `backend/app/services/trip_service.py`
- [Password security](https://github.com/geoxin3/wayfarer/blob/main/backend/app/core/security.py): `backend/app/core/security.py`

### Persistence

- [User records](https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [Destination records](https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/destination.py): `backend/app/models/destination.py`
- [Trip records](https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/trip.py): `backend/app/models/trip.py`
- [Trip-destination links](https://github.com/geoxin3/wayfarer/blob/main/backend/app/models/trip_destination.py): `backend/app/models/trip_destination.py`
- [Database sessions](https://github.com/geoxin3/wayfarer/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Other components

- **Traveler**
- **PostgreSQL**

## Connections

- Traveler → Route application: uses
- Route application → Account screens: routes to
- Route application → Destination screens: routes to
- Route application → Trip screens: routes to
- Route application → Admin screens: routes to
- Auth API helper → HTTP requests: requests
- Destination API helper → HTTP requests: requests
- Trip API helper → HTTP requests: requests
- HTTP requests → FastAPI application: sends API requests
- FastAPI application → Authentication routes: includes
- FastAPI application → Destination routes: includes
- FastAPI application → Trip routes: includes
- Authentication routes → Account service: calls
- Authentication routes → Database sessions: opens session
- Account service → User records: queries and writes
- Account service → Password security: hashes and verifies
- Destination service → Destination records: queries and writes
- Trip service → Trip records: queries and writes
- Trip service → Destination records: checks destination
- Trip service → Trip-destination links: queries and writes
- Database sessions → PostgreSQL: connects
