# farouk-haroun/won-dry-idea-platform architecture

> Architecture diagram of the GitHub repository farouk-haroun/won-dry-idea-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/farouk-haroun/won-dry-idea-platform
- Repository: https://github.com/farouk-haroun/won-dry-idea-platform

## Overview

##### Project type and purpose
- This is a full-stack MERN application called Wondr’y Ideas Platform.
- Purpose: a virtual collaboration and brainstorming space where users sign in, create/join idea spaces and challenges, upload files, rate and discuss ideas in real time.

##### File structure
Top-level directories:
- mongodb-backend – Node.js/Express REST API using Mongoose (models, controllers, routes, middleware)
- react-frontend – React SPA (components, screens, contexts, Redux slices, utilities)
- src (root) – appears to be an earlier or sample React shell (can be omitted if not actively used)

Key backend patterns:
- MVC structure: models/ → controllers/ → routes/ → server.js
- Middleware: authenticate JWT, S3 upload, custom test hooks
- Upload folder for local storage (thumbnails) and S3 integration

Key frontend patterns:
- Pages (“screens”) correspond to routes: Home, Discover, Challenge, IdeaSpace, Profile, Login, Signup
- Shared UI parts in components/ (cards, popups)
- Global state via React Context (IdeaSpaceContext) and Redux Toolkit (authSlice)
- Tests in Jest and React Testing Library

##### Extract architecture insights from README
- React front-end interacts with Node/Express backend over HTTP/REST
- Backend persists data in MongoDB Atlas (hosted or local)
- File sharing implemented via S3 (or local uploads initially), potential integration with Google Drive/Dropbox APIs
- Future integration with Miro/Openideal APIs for real-time collaboration

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        SPA["React SPA"]:::frontend
        subgraph "Screens"
            direction TB
            Home["Home"]:::frontend
            Discover["Discover"]:::frontend
            ChallengeList["Challenge List"]:::frontend
            ChallengeIdea["Challenge Idea View"]:::frontend
            IdeaDetail["Idea Detail"]:::frontend
            IdeaSpace["Idea Space"]:::frontend
            Profile["Profile"]:::frontend
            Login["Login"]:::frontend
            Signup["Signup"]:::frontend
        end
        subgraph "Components"
            direction TB
            ChallengeCard["ChallengeCard"]:::frontend
            IdeaCard["IdeaCard"]:::frontend
            IdeaSpaceCard["IdeaSpaceCard"]:::frontend
            AdminCreateChallengePopup["AdminCreateChallengePopup"]:::frontend
            ProfilePopup["ProfilePopup"]:::frontend
            ProfileSettingsPopup["ProfileSettingsPopup"]:::frontend
        end
        subgraph "State & Context"
            direction TB
            AuthSlice["authSlice"]:::frontend
            Store["Redux Store"]:::frontend
            IdeaSpaceContext["IdeaSpaceContext"]:::frontend
        end
        Constants["Constants"]:::frontend
        subgraph "Testing"
            direction TB
            JestConfig["Jest Config"]:::frontend
            SetupTests["Test Setup"]:::frontend
            TestUtil["Test Utilities"]:::frontend
        end
    end

    %% API Layer
    subgraph "API Layer"
        direction TB
        Server["Express API Server"]:::backend
        subgraph "Routes"
            direction TB
            UserRoute["userRoute.js"]:::backend
            IdeaRoute["ideaRoute.js"]:::backend
            IdeaSpaceRoute["ideaSpaceRoute.js"]:::backend
            ChallengeRoute["challengeRoute.js"]:::backend
            TeamRoute["teamRoute.js"]:::backend
        end
        subgraph "Controllers"
            direction TB
            UserController["userController.js"]:::backend
            IdeaController["ideaController.js"]:::backend
            IdeaSpaceController["ideaSpaceController.js"]:::backend
            ChallengeController["challengeController.js"]:::backend
            TeamController["teamController.js"]:::backend
        end
        subgraph "Models"
            direction TB
            UserModel["userModel.js"]:::backend
            IdeaModel["ideaModel.js"]:::backend
            IdeaSpaceModel["ideaSpaceModel.js"]:::backend
            ChallengeModel["challengeModel.js"]:::backend
            TeamModel["teamModel.js"]:::backend
        end
        subgraph "Middleware"
            direction TB
            AuthMiddleware["authenticate.js"]:::backend
            UploadMiddleware["upload.js"]:::backend
            S3Middleware["s3.js"]:::backend
            TestMiddleware["test.js"]:::backend
        end
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        direction TB
        MongoDB["MongoDB Atlas"]:::database
        LocalUploads["Uploads Folder"]:::database
    end

    %% External Integrations
    subgraph "External Integrations"
        direction TB
        S3["AWS S3"]:::external
        Miro["Miro API"]:::external
        GoogleDrive["Google Drive API"]:::external
        Dropbox["Dropbox API"]:::external
    end

    %% CI/CD
    CI["CI/CD Pipeline"]:::pipeline

    %% User
    User["User Browser"]:::external

    %% Connections
    User -->|"interacts with"| SPA
    SPA -->|"API calls"| Server
    Server -->|"CRUD via Mongoose"| MongoDB
    Server -->|"local upload"| LocalUploads
    Server -->|"upload/download"| S3
    Server -->|"integrate"| Miro
    Server -->|"integrate"| GoogleDrive
    Server -->|"integrate"| Dropbox
    CI -->|"build & test"| Server
    CI -->|"build & test"| SPA

    %% Click Events
    click SPA "https://github.com/farouk-haroun/won-dry-idea-platform/tree/main/react-frontend/src"
    click Home "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/home.js"
    click Discover "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/discover.js"
    click ChallengeList "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/challenge.js"
    click ChallengeIdea "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/challenge_idea.js"
    click IdeaDetail "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/idea.js"
    click IdeaSpace "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/idea_space.js"
    click Profile "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/profile.js"
    click Login "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/login.js"
    click Signup "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/screens/signup.js"
    click ChallengeCard "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/components/ChallengeCard.js"
    click IdeaCard "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/components/IdeaCard.js"
    click IdeaSpaceCard "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/components/IdeaSpaceCard.js"
    click AdminCreateChallengePopup "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/components/AdminCreateChallengePopup.js"
    click ProfilePopup "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/components/ProfilePopup.js"
    click ProfileSettingsPopup "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/components/ProfileSettingsPopup.js"
    click AuthSlice "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/store/authSlice.js"
    click Store "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/store/index.js"
    click IdeaSpaceContext "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/contexts/IdeaSpaceContext.js"
    click Constants "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/utils/constants.js"
    click JestConfig "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/jest.config.js"
    click SetupTests "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/setupTests.js"
    click TestUtil "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/react-frontend/src/testUtil.js"
    click Server "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/server.js"
    click UserModel "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/models/userModel.js"
    click IdeaModel "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/models/ideaModel.js"
    click IdeaSpaceModel "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/models/ideaSpaceModel.js"
    click ChallengeModel "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/models/challengeModel.js"
    click TeamModel "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/models/teamModel.js"
    click UserController "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/controllers/userController.js"
    click IdeaController "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/controllers/ideaController.js"
    click IdeaSpaceController "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/controllers/ideaSpaceController.js"
    click ChallengeController "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/controllers/challengeController.js"
    click TeamController "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/controllers/teamController.js"
    click UserRoute "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/routes/userRoute.js"
    click IdeaRoute "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/routes/ideaRoute.js"
    click IdeaSpaceRoute "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/routes/ideaSpaceRoute.js"
    click ChallengeRoute "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/routes/challengeRoute.js"
    click TeamRoute "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/routes/teamRoute.js"
    click AuthMiddleware "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/middleware/authenticate.js"
    click UploadMiddleware "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/middleware/upload.js"
    click S3Middleware "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/middleware/s3.js"
    click TestMiddleware "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/mongodb-backend/middleware/test.js"
    click LocalUploads "https://github.com/farouk-haroun/won-dry-idea-platform/tree/main/mongodb-backend/uploads/thumbnails"
    click CI "https://github.com/farouk-haroun/won-dry-idea-platform/blob/main/.github/workflows/ci.yml"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#333,stroke-width:1px
    classDef backend fill:#C8E6C9,stroke:#333,stroke-width:1px
    classDef database fill:#E0E0E0,stroke:#333,stroke-width:1px
    classDef external fill:#FFE0B2,stroke:#333,stroke-width:1px
    classDef pipeline fill:#D1C4E9,stroke:#333,stroke-width:1px
```
