# sekju/notion-to-wp_fluentcommunity-import architecture

> Architecture diagram of the GitHub repository sekju/notion-to-wp_fluentcommunity-import, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sekju/notion-to-wp_fluentcommunity-import
- Repository: https://github.com/sekju/notion-to-wp_fluentcommunity-import

## Overview

##### Project type and purpose
- This is a full-stack single-page application whose purpose is to import content from Notion into a WordPress-based FluentCommunity site.
- Key features: React/TypeScript frontend (Vite), Node.js/Express backend proxy, integration with Notion API and WordPress REST API via a custom WordPress plugin.

##### File structure
- Top level
- `/src` – React SPA code (App.tsx, components, services, types, utils)
- `/server` – Node/Express API (index.js)
- `fluent-community-importer.php` + `functions.php` – WordPress plugin code
- Config files (vite.config.ts, tsconfig*.json, postcss.config.js, tailwind.config.js, Procfile, railway.json)
- Patterns
- “frontend vs. backend” separation
- Service layer in `src/services` (notionApi, wordpressApi, importService)
- Wizard-style UI in `src/components/Steps`
- Deployment artifacts
- `Procfile`/`railway.json` for Railway
- `.env.example` for secrets

##### README for additional insights
- Architecture described implicitly:
- Frontend makes API calls to `/server`
- Server proxies calls to Notion and WordPress APIs
- WordPress plugin extends WP REST endpoints to receive course/lesson payloads
- Dependencies & stack: Node.js 18+, React, Vite, Express, Notion SDK, standard REST calls to WP.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend (React SPA)" 
        direction TB
        Browser["Browser"]:::frontend
        subgraph "Source Files"
            direction TB
            Main["src/main.tsx"]:::frontend
            App["src/App.tsx"]:::frontend
            CSS["src/index.css"]:::frontend
            HTML["index.html"]:::frontend
            ViteConfig["vite.config.ts"]:::frontend
            Tailwind["tailwind.config.js"]:::frontend
            PostCSS["postcss.config.js"]:::frontend
            TSConfigApp["tsconfig.app.json"]:::frontend
        end
        subgraph "Import Wizard UI"
            direction TB
            Wizard["src/components/ImportWizard.tsx"]:::frontend
            Step1["src/components/Steps/Step1Configuration.tsx"]:::frontend
            Step2["src/components/Steps/Step2Selection.tsx"]:::frontend
            Step3["src/components/Steps/Step3Progress.tsx"]:::frontend
            Header["src/components/Layout/Header.tsx"]:::frontend
        end
        subgraph "Service Layer"
            direction TB
            NotionAPI["src/services/notionApi.ts"]:::frontend
            WPAPI["src/services/wordpressApi.ts"]:::frontend
            ImportService["src/services/importService.ts"]:::frontend
        end
        subgraph "Utils & Types"
            direction TB
            StorageUtil["src/utils/storage.ts"]:::frontend
            Types["src/types/index.ts"]:::frontend
        end
    end

    %% Local Storage
    LocalStorage["Local Storage"]:::storage

    %% Backend Layer
    subgraph "Backend (Express API)" 
        direction TB
        ServerIndex["server/index.js"]:::backend
        ServerPkg["server/package.json"]:::backend
        ServerLock["server/package-lock.json"]:::backend
    end

    %% External Services
    subgraph "External Services"
        direction TB
        Notion["Notion API"]:::external
        subgraph "WordPress Site"
            direction TB
            WPPlugin["Custom Plugin"]:::external
            PluginMain["fluent-community-importer.php"]:::external
            PluginFuncs["functions.php"]:::external
        end
    end

    %% Deployment
    subgraph "Deployment"
        direction TB
        Railway["Railway"]:::deployment
        Hosting["Vercel/Netlify"]:::deployment
    end

    %% Connections
    Browser -->|"calls API"| ServerIndex
    Browser -->|"uses"| LocalStorage
    ServerIndex -->|"GET content"| Notion
    ServerIndex -->|"POST payload"| WPPlugin
    Hosting -->|serves| Browser
    Railway -->|hosts| ServerIndex

    %% Click Events
    click Main "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/main.tsx"
    click App "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/App.tsx"
    click CSS "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/index.css"
    click HTML "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/index.html"
    click ViteConfig "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/vite.config.ts"
    click Tailwind "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/tailwind.config.js"
    click PostCSS "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/postcss.config.js"
    click TSConfigApp "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/tsconfig.app.json"
    click Wizard "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/components/ImportWizard.tsx"
    click Step1 "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/components/Steps/Step1Configuration.tsx"
    click Step2 "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/components/Steps/Step2Selection.tsx"
    click Step3 "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/components/Steps/Step3Progress.tsx"
    click Header "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/components/Layout/Header.tsx"
    click NotionAPI "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/services/notionApi.ts"
    click WPAPI "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/services/wordpressApi.ts"
    click ImportService "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/services/importService.ts"
    click StorageUtil "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/utils/storage.ts"
    click Types "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/src/types/index.ts"
    click ServerIndex "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/server/index.js"
    click ServerPkg "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/server/package.json"
    click ServerLock "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/server/package-lock.json"
    click PluginMain "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/fluent-community-importer.php"
    click PluginFuncs "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/functions.php"
    click Railway "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/railway.json"
    click Hosting "https://github.com/sekju/notion-to-wp_fluentcommunity-import/blob/main/.env.example"

    %% Styles
    classDef frontend fill:#E8F1FF,stroke:#3B82F6,stroke-width:1px;
    classDef backend fill:#E6FFED,stroke:#10B981,stroke-width:1px;
    classDef external fill:#FFF7E6,stroke:#F59E0B,stroke-width:1px;
    classDef storage fill:#F3E8FF,stroke:#8B5CF6,stroke-width:1px;
    classDef deployment fill:#F0F9FF,stroke:#0284C7,stroke-width:1px;
```
