# alaaduridi/mynotekeeper architecture

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

- Interactive diagram: https://gitdiagram.com/alaaduridi/mynotekeeper
- Repository: https://github.com/alaaduridi/mynotekeeper

## Overview

##### Project Type and Purpose
- Full-stack note-management application
- Frontend: React (TypeScript) + Vite
- Backend: Node.js + Express + Mongoose (MongoDB)
- Purpose: CRUD operations on notes, with search and pagination

##### File Structure
- Top-level directories:
– client/ → React SPA
– server/ → Express REST API
- client/src/components, views, hooks, services → component-based UI + client-side business logic
- server/controllers, routes, models → classic MVC pattern
- server/dev-data → CLI-style data import/delete scripts
- Configuration files:
– client/vite.config.ts, tsconfig*.json
– server/config.env
– root package.json for monorepo scripts

##### Summarize Key README Insights
- REST endpoints under /api/notes with standard CRUD plus pagination & search
- MongoDB runs locally, Mongoose for ODM
- Dev-data scripts load or delete sample JSON data
- NPM scripts: “dev” on both client and server

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend (Port 5173)"
        direction TB
        Browser["Browser / React SPA"]:::frontend
        subgraph "React UI"
            direction TB
            AddNote["AddNote Component"]:::frontend
            NotesList["NotesList Component"]:::frontend
            NoteCard["NoteCard Component"]:::frontend
            NoteDialog["NoteDialog Component"]:::frontend
            ConfirmDialog["ConfirmDialog Component"]:::frontend
            SearchBar["SearchBar Component"]:::frontend
        end
        subgraph "Views"
            direction TB
            AppShell["App.tsx (Application Shell)"]:::frontend
        end
        subgraph "Services"
            direction TB
            NotesService["notes.service.ts"]:::frontend
        end
        subgraph "Build & Config"
            direction TB
            ViteConfig["vite.config.ts"]:::frontend
            TSConfig["tsconfig*.json"]:::frontend
            ESLintConfig["eslint.config.js"]:::frontend
        end
    end

    %% Backend Layer
    subgraph "Backend (Port 5000)"
        direction TB
        APIServer["Express Server (server.js)"]:::backend
        AppSetup["app.js"]:::backend
        subgraph "API Layer"
            direction TB
            Router["noteRouter.js"]:::backend
            Controller["noteController.js"]:::backend
            Model["noteModel.js"]:::backend
        end
        subgraph "Dev-Data CLI"
            direction TB
            ImportDev["import-dev-data.js"]:::auxiliary
            SampleData["notes-simple.json"]:::auxiliary
        end
        subgraph "Config"
            direction TB
            Env["config.env"]:::backend
            PackageServer["package.json"]:::backend
        end
        DB["MongoDB"]:::db
    end

    %% Data Flows
    Browser -->|"loads index.html"| AppShell
    AppShell -->|"renders UI components"| AddNote
    AppShell --> NotesList
    AppShell --> NoteCard
    AppShell --> NoteDialog
    AppShell --> ConfirmDialog
    AppShell --> SearchBar
    AddNote --> NotesService
    NotesList --> NotesService
    NoteCard --> NotesService
    NoteDialog --> NotesService
    ConfirmDialog --> NotesService
    SearchBar --> NotesService
    NotesService -->|HTTP GET/POST /api/notes| APIServer
    APIServer --> AppSetup
    AppSetup --> Router
    Router --> Controller
    Controller --> Model
    Model --> DB
    DB --> Model
    Model --> Controller
    Controller --> Router
    Router --> APIServer
    APIServer -->|HTTP response| NotesService
    ImportDev -->|connects to DB| DB

    %% Click Events
    click AddNote "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/components/AddNote/AddNote.tsx"
    click NotesList "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/components/NotesList/NotesList.tsx"
    click NoteCard "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/components/NoteCard/NoteCard.tsx"
    click NoteDialog "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/components/NoteDialog/NoteDialog.tsx"
    click ConfirmDialog "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/components/ConfirmDialog/ConfirmDialog.tsx"
    click SearchBar "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/components/SearchBar/SearchBar.tsx"
    click AppShell "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/views/app/App.tsx"
    click NotesService "https://github.com/alaaduridi/mynotekeeper/blob/main/client/src/services/notes.service.ts"
    click ViteConfig "https://github.com/alaaduridi/mynotekeeper/blob/main/client/vite.config.ts"
    click TSConfig "https://github.com/alaaduridi/mynotekeeper/blob/main/client/tsconfig.json"
    click ESLintConfig "https://github.com/alaaduridi/mynotekeeper/blob/main/client/eslint.config.js"
    click APIServer "https://github.com/alaaduridi/mynotekeeper/blob/main/server/server.js"
    click AppSetup "https://github.com/alaaduridi/mynotekeeper/blob/main/server/app.js"
    click Router "https://github.com/alaaduridi/mynotekeeper/blob/main/server/routes/noteRouter.js"
    click Controller "https://github.com/alaaduridi/mynotekeeper/blob/main/server/controllers/noteController.js"
    click Model "https://github.com/alaaduridi/mynotekeeper/blob/main/server/models/noteModel.js"
    click ImportDev "https://github.com/alaaduridi/mynotekeeper/blob/main/server/dev-data/data/import-dev-data.js"
    click SampleData "https://github.com/alaaduridi/mynotekeeper/blob/main/server/dev-data/data/notes-simple.json"
    click Env "https://github.com/alaaduridi/mynotekeeper/blob/main/server/config.env"
    click PackageServer "https://github.com/alaaduridi/mynotekeeper/blob/main/server/package.json"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#006064,color:#006064
    classDef backend fill:#E8F5E9,stroke:#1B5E20,color:#1B5E20
    classDef db fill:#FFF3E0,stroke:#EF6C00,color:#EF6C00
    classDef auxiliary fill:none,stroke:#757575,stroke-dasharray: 5 5,color:#424242
```
