# distrad/ign_tattoo architecture

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

- Interactive diagram: https://gitdiagram.com/distrad/ign_tattoo
- Repository: https://github.com/distrad/ign_tattoo

## Overview

Based on our analysis of both the file tree and README, IgnTattoo is a full-stack mobile social platform for tattoo artists and designers. The project is divided into two main parts:
- A backend built with Node.js and Express.js (in the “backend-ign-tattoo-app” directory) that serves as the REST API and handles business logic.
- A mobile frontend built with React Native using Expo (in the “frontend-Ign-Tattoo-App” directory) that offers the client-side experience.

##### Main Components
a. Mobile Frontend (React Native/Expo):
- Contains screens like authentication, profile management, appointment scheduling, messaging, and collaborative project views.
- Uses Expo for building and OTA updates, along with libraries for animations (Reanimated/GestureHandler) and styling (NativeWind).
b. Backend API (Node.js/Express.js):
- Implements RESTful endpoints for authentication, user management, appointments, and designer projects.
- Manages assets (e.g., image uploads) and handles the business logic.
c. Database (PostgreSQL):
- Stores user data, appointment details, and designer project information.
- Represents relational data concerning users, appointments, and projects, as outlined in the README.
d. DevOps / External Services:
- GitHub Actions, Expo Application Services, and optionally Docker for containerization.
- These may be represented as supporting components or labels showing CI/CD, deployment processes, and OTA updates.

##### Relationships and Interactions
- The Mobile Frontend interacts with the Backend API over HTTP(s) using REST calls.
– Indicate data flows for user authentication, data fetching (e.g., portfolio images, project details), and appointment management.
- The Backend communicates with the PostgreSQL database for persistent storage.
- DevOps components (GitHub Actions, Docker) are connected with both the frontend and backend deployment processes.

##### Architectural Patterns & Design Principles
- Clearly demarcate the separation of concerns: the frontend is solely responsible for user interaction while the backend manages data and business logic.
- RESTful API endpoints and the relational database model clearly.
- If desired, use distinct grouping for authentication flows (using JWT) as these cross-cut both frontend and backend.

- Frontend: React Native (Expo), NativeWind, Reanimated, Image Pickers.
- Backend: Node.js, Express.js.
- Database: PostgreSQL.
- Other: GitHub Actions for CI/CD, possibly Docker for containerization.
- Where push notifications or OTA update services (Expo Application Services) come into play.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mobile Frontend Subgraph
    subgraph "Mobile Frontend"
        FE["Mobile App (React Native/Expo)"]:::frontend
        FE_Screens["Screens & Navigation"]:::frontend
        FE_Config["Configuration Files"]:::frontend
        FE --> FE_Screens
        FE --> FE_Config
        FE_Config_1["app.json"]:::frontend
        FE_Config_2["babel.config.js"]:::frontend
        FE_Config_3["tsconfig.json"]:::frontend
        FE_Config_4["tailwind.config.js"]:::frontend
        FE_Config --> FE_Config_1
        FE_Config --> FE_Config_2
        FE_Config --> FE_Config_3
        FE_Config --> FE_Config_4
    end

    %% Backend API Subgraph
    subgraph "Backend API"
        BE["Express.js API Server"]:::backend
        BE_Routing["Routing & Middleware"]:::backend
        BE_Business["Business Logic (Authentication, Appointments, Projects)"]:::backend
        BE_Assets["Asset Handling"]:::backend
        BE_Pkgs["Package Files"]:::backend
        BE --> BE_Routing
        BE --> BE_Business
        BE --> BE_Assets
        BE --> BE_Pkgs

        BE_Assets_A["Assets Directory"]:::backend
        BE_Assets_U["Uploads Directory"]:::backend
        BE_Assets --> BE_Assets_A
        BE_Assets --> BE_Assets_U

        BE_Pkg1["package.json"]:::backend
        BE_Pkg2["package-lock.json"]:::backend
        BE_Pkgs --> BE_Pkg1
        BE_Pkgs --> BE_Pkg2
    end

    %% PostgreSQL Database Subgraph
    subgraph "PostgreSQL Database"
        DB["PostgreSQL"]:::database
        DB_Users["Users Table"]:::database
        DB_Appointments["Appointments Table"]:::database
        DB_Projects["Designer Projects Table"]:::database
        DB --> DB_Users
        DB --> DB_Appointments
        DB --> DB_Projects

        DB_Script1["BACKUPBASE.sql"]:::database
        DB_Script2["bdd.sql"]:::database
        DB_Script3["bdd_sin_limpiar.sql"]:::database
        DB_Users --- DB_Script1
        DB_Appointments --- DB_Script2
        DB_Projects --- DB_Script3
    end

    %% DevOps / External Services Subgraph
    subgraph "DevOps / External Services"
        DEV["CI/CD & OTA"]:::devops
        DEV_Config["Expo OTA & CI/CD Config"]:::devops
        DEV --> DEV_Config
        DEV_Config2["elements-config.json"]:::devops
        DEV_Config --> DEV_Config2
    end

    %% Connections between primary components
    FE -->|"RESTful_API_calls(JSON_payloads)"| BE
    BE -->|"SQL_CRUD_operations"| DB
    DEV -->|"Deploy_Update"| FE
    DEV -->|"Deploy_Update"| BE

    %% Click Events for Mobile Frontend
    click FE "https://github.com/distrad/ign_tattoo/tree/main/frontend-Ign-Tattoo-App"
    click FE_Screens "https://github.com/distrad/ign_tattoo/tree/main/frontend-Ign-Tattoo-App/app"
    click FE_Config_1 "https://github.com/distrad/ign_tattoo/blob/main/frontend-Ign-Tattoo-App/app.json"
    click FE_Config_2 "https://github.com/distrad/ign_tattoo/blob/main/frontend-Ign-Tattoo-App/babel.config.js"
    click FE_Config_3 "https://github.com/distrad/ign_tattoo/blob/main/frontend-Ign-Tattoo-App/tsconfig.json"
    click FE_Config_4 "https://github.com/distrad/ign_tattoo/blob/main/frontend-Ign-Tattoo-App/tailwind.config.js"

    %% Click Events for Backend API
    click BE "https://github.com/distrad/ign_tattoo/blob/main/backend-ign-tattoo-app/index.js"
    click BE_Assets_A "https://github.com/distrad/ign_tattoo/tree/main/backend-ign-tattoo-app/assets"
    click BE_Assets_U "https://github.com/distrad/ign_tattoo/tree/main/backend-ign-tattoo-app/uploads"
    click BE_Pkg1 "https://github.com/distrad/ign_tattoo/blob/main/backend-ign-tattoo-app/package.json"
    click BE_Pkg2 "https://github.com/distrad/ign_tattoo/blob/main/backend-ign-tattoo-app/package-lock.json"

    %% Click Events for PostgreSQL Database
    click DB_Script1 "https://github.com/distrad/ign_tattoo/blob/main/BACKUPBASE.sql"
    click DB_Script2 "https://github.com/distrad/ign_tattoo/blob/main/bdd.sql"
    click DB_Script3 "https://github.com/distrad/ign_tattoo/blob/main/bdd_sin_limpiar.sql"

    %% Click Events for DevOps / External Services
    click DEV_Config "https://github.com/distrad/ign_tattoo/blob/main/frontend-Ign-Tattoo-App/eas.json"
    click DEV_Config2 "https://github.com/distrad/ign_tattoo/blob/main/frontend-Ign-Tattoo-App/elements-config.json"

    %% Styles
    classDef frontend fill:#bbf,stroke:#333,stroke-width:2px;
    classDef backend fill:#cfc,stroke:#333,stroke-width:2px;
    classDef database fill:#fbb,stroke:#333,stroke-width:2px;
    classDef devops fill:#ffd54f,stroke:#333,stroke-width:2px;
```
