# louismasson/friendly_seoscanner architecture

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

- Interactive diagram: https://gitdiagram.com/louismasson/friendly_seoscanner
- Repository: https://github.com/louismasson/friendly_seoscanner

## Overview

##### Project Type & Purpose
- The project is a full-stack web application designed to analyze a website’s SEO metrics. It provides Google search and social media previews, meta tag analysis, and recommendations for SEO improvements.
- The frontend is built with React and TypeScript, while the backend uses Express.js. It also integrates Tailwind CSS (with ShadCN UI components) for styling and leverages React Query for state management.

##### Analyzing the File Structure
- Top-level directories include:
- “client”: Contains the React frontend application, including pages, components (with a large set of UI components), hooks, and utility libraries.
- “server”: Holds the Express.js backend code (files like index.ts, routes.ts, storage.ts, and vite.ts suggesting a server-side rendering or development setup).
- “shared”: Contains shared schemas and types used across both the client and server, ensuring consistency in the data model.
- There are configuration files for Tailwind, Vite, TypeScript, and other build tools indicating an integrated build, deployment, and development environment.
- The structure suggests clear separation between client and server code as well as shared modules.

##### Diagramming the Architecture
a. Main Components:
- Frontend Client:
- React Application Entry (client/main.tsx)
- Pages (client/src/pages: home, not-found)
- UI Components (client/src/components and client/src/components/ui) which include all visual elements (SEO previews, scorecards, recommendations, etc.).
- Hooks and Utility Libraries (client/src/hooks, client/src/lib)
- Routing & State Management (Wouter for routing, React Query, React Hook Form)
- Backend Server:
- API Server (server/index.ts)
- Routing Logic (server/routes.ts)
- Storage or Data Handling (server/storage.ts)
- Additional Server Configuration (server/vite.ts)
- Shared Module:
- Shared Schemas & Types (shared/schema.ts) to standardize data contracts between client and server.
- External Services & Dependencies:
- Third-party libraries: Tailwind CSS, ShadCN UI, React Query, React Hook Form, Zod, and others mentioned in the README.

b. Relationships & Interactions:
- The Frontend communicates with the Backend API for running SEO analysis (for example, the service defined in client/src/services/seo-analyzer.ts calls the Express endpoints).
- Data contracts between client and server are unified through the Shared module, ensuring that both sides use consistent schemas.
- User interactions on the frontend (URL input, navigation through pages) trigger API calls whose responses update the UI with SEO results.
- The server processes requests, routes them through Express, possibly uses storage logic, and returns JSON responses representing analysis data to the client.

c. Architectural Patterns/Design Principles:
- Separation of Concerns: Clear split between frontend (UI/interaction logic) and backend (data processing & API endpoints).
- Modularization: Each major functionality (UI components, services, shared schema) is contained in its own directory.
- Reusability & Scalability: The extensive UI components library suggests a highly reusable interface framework.
- API-Driven Communication: Frontend and backend interact over well-defined REST endpoints (as configured in routes.ts).

d. Relevant Technologies/Frameworks to Note:
- Frontend: React, TypeScript, Tailwind CSS, shadcn/ui components.
- Backend: Express.js, Node.js.
- State Management: React Query, React Hook Form with Zod validation.
- Routing: Wouter in the client; Express routes on the server.
- Shared Data: Shared schemas and types ensure consistency across modules.

- Main Application Entry (client/main.tsx)
- Pages (Home, Not Found)
- Services (SEO Analyzer Service)
- UI Components (with further details on category previews, toggles, etc.)
- Hooks and Libraries (for state and form management)
- In the Backend block, detail:
- API Entry Point (server/index.ts)
- Routes (server/routes.ts)
- Data/Storage Handling (server/storage.ts)
- Configuration/Build Tools (e.g., server/vite.ts)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Client Subgraph
    subgraph "Frontend Client (React + TS)"
        FE1("Main Entry"):::frontend
        FE2("Pages"):::frontend
        FE3("UI Components"):::frontend
        FE4("UI Components UI"):::frontend
        FE5("Hooks"):::frontend
        FE6("Libraries"):::frontend
        FE7("SEO Analyzer Service"):::frontend
    end

    %% Backend Server Subgraph
    subgraph "Backend Server (Express.js)"
        BE1("API Server Entry"):::backend
        BE2("Routing Logic"):::backend
        BE3("Storage Handling"):::backend
        BE4("Server Configuration"):::backend
    end

    %% Shared Module Subgraph
    subgraph "Shared Module"
        SH1("Shared Schemas & Types"):::shared
    end

    %% Connections in Frontend
    FE1 -->|"renders"| FE2
    FE2 -->|"triggers"| FE7

    %% Frontend to Backend
    FE7 -->|"calls"| BE2
    BE2 -->|"retrieves"| BE3
    BE2 -->|"responds"| FE7

    %% Shared Dependencies
    FE7 -->|"uses"| SH1
    BE2 -->|"uses"| SH1

    %% Click Events for Frontend
    click FE1 "https://github.com/louismasson/friendly_seoscanner/blob/main/client/src/main.tsx"
    click FE2 "https://github.com/louismasson/friendly_seoscanner/tree/main/client/src/pages"
    click FE3 "https://github.com/louismasson/friendly_seoscanner/tree/main/client/src/components"
    click FE4 "https://github.com/louismasson/friendly_seoscanner/tree/main/client/src/components/ui"
    click FE5 "https://github.com/louismasson/friendly_seoscanner/tree/main/client/src/hooks"
    click FE6 "https://github.com/louismasson/friendly_seoscanner/tree/main/client/src/lib"
    click FE7 "https://github.com/louismasson/friendly_seoscanner/blob/main/client/src/services/seo-analyzer.ts"

    %% Click Events for Backend
    click BE1 "https://github.com/louismasson/friendly_seoscanner/blob/main/server/index.ts"
    click BE2 "https://github.com/louismasson/friendly_seoscanner/blob/main/server/routes.ts"
    click BE3 "https://github.com/louismasson/friendly_seoscanner/blob/main/server/storage.ts"
    click BE4 "https://github.com/louismasson/friendly_seoscanner/blob/main/server/vite.ts"

    %% Click Event for Shared Module
    click SH1 "https://github.com/louismasson/friendly_seoscanner/blob/main/shared/schema.ts"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef shared fill:#fff3cd,stroke:#333,stroke-width:2px;
```
