# rodrii-dp/freetour architecture

> Architecture diagram of the GitHub repository rodrii-dp/freetour, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rodrii-dp/freetour
- Repository: https://github.com/rodrii-dp/freetour

## Overview

##### Project Type and Purpose
- The project is a full-stack mobile application named “FreeTour.”
- The backend (located in the “backend” folder) uses NestJS (observable from files like nest-cli.json, app.module.ts, and main.ts) to expose APIs and handle business logic.
- The frontend (in the “frontend” folder) is a React Native application, as indicated by its structure (Android and iOS directories, metro.config.js, and multiple .tsx files for screens and navigation).

##### File Structure
- Top-Level Separation: The project is clearly divided into two main parts—“frontend” and “backend.”
- “Backend”: Contains standard NestJS structure (controllers, modules, services) along with test directories and configuration files (eslintrc, tsconfig, etc.). This indicates that the API and business logic are handled here.
- “Frontend”: Contains directories for native builds (“android” and “ios”), a well-organized “src” folder (with subfolders for presentation components, screens, navigators, hooks, and domain entities), and configuration files for bundling and testing. This suggests a clean separation of presentation, domain, and configuration layers typical in mobile applications.

##### Readme and Additional Insights
- Although minimal, the README title “FreeTour” confirms the app’s focus.

a. Main Components to Include:
- Mobile Clients:
- iOS Application (from the “ios” directory)
- Android Application (from the “android” directory)
- Shared React Native Code (mainly in the “src” folder with screens, navigators, and components)
- Backend Service:
- API Server built on NestJS (the “backend” folder with controllers, modules, and services)
- Optional Supporting Elements:
- Testing components (unit tests and e2e tests present in both frontend and backend)

b. Relationships and Interactions:

c. Architectural Patterns:
- For the backend:
- Modular NestJS architecture (with controllers, services, and modules) as a clear separation of concerns.
- For the frontend:
- Component-based design (common reusable components, hook-based logic, and a clear separation between domain entities and presentation components).

d. Technologies and Libraries:
- Backend:
- NestJS, TypeScript, testing frameworks (Jest used in the NestJS test folder).
- Frontend:
- React Native (along with TypeScript as seen in .tsx files), and navigation libraries (inferred from navigator files such as BottomTabsNavigator.tsx and HomeStackNavigator.tsx).
- Additional tools like ESLint, Prettier, and bundling configurations related to React Native.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Mobile Clients"
        subgraph "Native Platforms"
            iOS["iOS Application"]:::native
            Android["Android Application"]:::native
        end
        ReactNative["React Native Shared Code"]:::shared
        subgraph "Presentation Layer"
            Navigator["Navigation Components"]:::presentation
            Screens["Presentation Screens"]:::presentation
            Components["Reusable Presentation Components"]:::presentation
        end
    end

    subgraph "Backend API"
        NestJS["NestJS API Server\n(Controllers,Modules,Services)"]:::backend
    end

    iOS -->|"sendsRequests"| NestJS
    Android -->|"sendsRequests"| NestJS
    ReactNative -->|"handlesUILogic"| Navigator
    ReactNative -->|"displaysUI"| Screens
    ReactNative -->|"utilizes"| Components
    Navigator ---|"navigatesTo"| Screens
    Screens ---|"incorporates"| Components
    ReactNative ---|"APICalls"| NestJS

    click iOS "https://github.com/rodrii-dp/freetour/tree/main/frontend/ios/frontend"
    click Android "https://github.com/rodrii-dp/freetour/tree/main/frontend/android/app"
    click ReactNative "https://github.com/rodrii-dp/freetour/tree/main/frontend/src"
    click NestJS "https://github.com/rodrii-dp/freetour/tree/main/backend"
    click Navigator "https://github.com/rodrii-dp/freetour/tree/main/frontend/src/presentation/navigator"
    click Screens "https://github.com/rodrii-dp/freetour/tree/main/frontend/src/presentation/screens"
    click Components "https://github.com/rodrii-dp/freetour/tree/main/frontend/src/presentation/components/common"

    classDef native fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef shared fill:#B3E5FC,stroke:#000,stroke-width:2px;
    classDef presentation fill:#FFECB3,stroke:#000,stroke-width:2px;
    classDef backend fill:#C8E6C9,stroke:#000,stroke-width:2px;
```
