# nithish699/fullstack_universiyofhelsinki architecture

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

- Interactive diagram: https://gitdiagram.com/nithish699/fullstack_universiyofhelsinki
- Repository: https://github.com/nithish699/fullstack_universiyofhelsinki

## Overview

- A **high-level overview** showing each Part as a module,
- Or focus on the **full-stack Part 3** as the flagship exercise.

##### Project Type & Purpose
- It’s a **learning submission repository** containing:
- Part 0: notes and markdown pages (static content)
- Part 1: three pure React single-page apps (Anecdotes, Courseinfo, Unicafe) built with Vite
- Part 2: three React apps that call external services (Countries API, Course API, JSON-server Phonebook)
- Part 3: a **full-stack phonebook**—React front-end + Node/Express backend exposing REST endpoints, backed by a simple JSON file.

##### File Structure
- **Top-level directories:** Part0, Part1, Part2, Part3
- **React apps** share a pattern:
frontend asset root (index.html, public/) → src/ (main.jsx, App.jsx, components/) → package.json + Vite config
- **Services layer** in Part 2/phonebook: `src/services/persons.js` makes HTTP calls to a JSON-server
- **Part 3/phonebook**:
- `index.js` sets up Express routes
- `requests/*.rest` are sample HTTP calls (for testing with REST Client)
- No build pipeline—Node app runs directly under `node index.js`

##### Extract README Insights
- Confirms this is a **full-stack course submission**.
- Technologies: React, Vite, Node.js, Express, ESLint.

a. **Main Components**
- For each React app:
- **Browser / User**
- **Vite Dev Server** (local dev) / Build Pipeline (prod)
- **React UI Components** (App.jsx, subcomponents)
- **Static Assets** (public folder, CSS)
- For Part 2 that uses APIs:
- **Service Modules** (`services/*.js`)
- **External APIs** (e.g., REST Countries, OpenWeather)
- For Part 3 full-stack:
- **Frontend** (React + Vite)
- **HTTP Client** (axios or fetch calls)
- **Express Backend** (Node.js, index.js)
- **Data Store** (JSON file or in-memory array)
- **REST Endpoints** (GET /api/persons, POST, DELETE, etc.)
b. **Relationships & Interactions**
- User interactions flow into the browser → React UI → service modules → API calls
- For full-stack: React → HTTP → Express routes → Data store → Express → React
c. **Architectural Patterns**
- **Component-based UI** (React)
- **Separation of Concerns**: UI vs. data-access (services folder) vs. server logic
- **RESTful API** in Part 3
d. **Key Technologies**
- React + JSX, Vite, ESLint
- axios or fetch in services
- Node.js, Express for backend
- JSON file storage (or JSON-server in Part 2)
- Optional: REST Client tool (.rest files)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "fullStack_openCourse"
        subgraph "Part 0: Static Notes"
            P0["Markdown Notes"]:::external
        end

        subgraph "Part 1: Pure React SPAs"
            subgraph "Anecdotes App"
                ANE_DIR["Part1/anecdotes/"]:::external
                ANE_INDEX["index.html"]:::frontend
                ANE_SRC["src/"]:::frontend
                ANE_MAIN["main.jsx"]:::frontend
                ANE_DIR --> ANE_INDEX --> ANE_SRC --> ANE_MAIN
            end
            subgraph "Courseinfo App"
                CI_DIR["Part1/courseinfo/"]:::external
                CI_INDEX["index.html"]:::frontend
                CI_SRC["src/"]:::frontend
                CI_MAIN["main.jsx"]:::frontend
                CI_DIR --> CI_INDEX --> CI_SRC --> CI_MAIN
            end
            subgraph "Unicafe App"
                UNI_DIR["Part1/unicafe/"]:::external
                UNI_INDEX["index.html"]:::frontend
                UNI_SRC["src/"]:::frontend
                UNI_MAIN["main.jsx"]:::frontend
                UNI_DIR --> UNI_INDEX --> UNI_SRC --> UNI_MAIN
            end
        end

        subgraph "Part 2: React w/ External Services"
            subgraph "Countries App"
                CNT_DIR["Part2/countries/"]:::external
                CNT_INDEX["index.html"]:::frontend
                CNT_UI["React UI"]:::frontend
                CNT_SERV["Service Modules"]:::service
                CNT_API1["REST Countries API"]:::external
                CNT_API2["Weather API"]:::external
                CNT_DIR --> CNT_INDEX --> CNT_UI --> CNT_SERV
                CNT_SERV --> CNT_API1
                CNT_SERV --> CNT_API2
            end
            subgraph "Courseinfo API App"
                CAPI_DIR["Part2/courseinfo/"]:::external
                CAPI_INDEX["index.html"]:::frontend
                CAPI_UI["React UI"]:::frontend
                CAPI_SERV["Service Module"]:::service
                CAPI_API["Course API"]:::external
                CAPI_DIR --> CAPI_INDEX --> CAPI_UI --> CAPI_SERV --> CAPI_API
            end
            subgraph "Phonebook Client"
                PBC_DIR["Part2/phonebook/"]:::external
                PBC_INDEX["index.html"]:::frontend
                PBC_UI["React UI"]:::frontend
                PBC_SERV["persons.js"]:::service
                PBC_JSON["JSON-server"]:::external
                PBC_DIR --> PBC_INDEX --> PBC_UI --> PBC_SERV --> PBC_JSON
            end
        end

        subgraph "Part 3: Full-Stack Phonebook"
            FS_DIR["Part3/phonebook/"]:::external
            FS_FE["React Frontend"]:::frontend
            FS_HTTP["HTTP Client"]:::service
            FS_BE["Express Server (index.js)"]:::backend
            FS_DATA["JSON Data Store"]:::datastore
            FS_REQS["requests/*.rest"]:::external
            FS_DIR --> FS_REQS
            FS_DIR --> FS_BE --> FS_DATA
            FS_FE --> FS_HTTP --> FS_BE
        end
    end

    click P0 "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part0/"
    click ANE_DIR "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part1/anecdotes/"
    click ANE_INDEX "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part1/anecdotes/index.html"
    click ANE_SRC "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part1/anecdotes/src/"
    click ANE_MAIN "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part1/anecdotes/src/main.jsx"
    click CI_DIR "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part1/courseinfo/"
    click CI_INDEX "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part1/courseinfo/index.html"
    click CI_SRC "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part1/courseinfo/src/"
    click CI_MAIN "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part1/courseinfo/src/main.jsx"
    click UNI_DIR "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part1/unicafe/"
    click UNI_INDEX "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part1/unicafe/index.html"
    click UNI_SRC "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part1/unicafe/src/"
    click UNI_MAIN "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part1/unicafe/src/main.jsx"
    click CNT_DIR "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part2/countries/"
    click CAPI_DIR "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part2/courseinfo/"
    click PBC_DIR "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part2/phonebook/"
    click PBC_SERV "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part2/phonebook/src/services/persons.js"
    click FS_DIR "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part3/phonebook/"
    click FS_BE "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part3/phonebook/index.js"
    click FS_REQS "https://github.com/nithish699/fullstack_universiyofhelsinki/tree/main/Part3/phonebook/requests/"
    click FS_BE "https://github.com/nithish699/fullstack_universiyofhelsinki/blob/main/Part3/phonebook/package.json"

    classDef frontend fill:#D6EFFF,stroke:#1f77b4
    classDef backend fill:#D5E8D4,stroke:#2ca02c
    classDef service fill:#FFF2CC,stroke:#ff7f0e
    classDef datastore fill:#F8CECC,stroke:#d62728
    classDef external fill:#F5F5F5,stroke:#7f7f7f
```
