# ycluis/fullstackopen architecture

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

- Interactive diagram: https://gitdiagram.com/ycluis/fullstackopen
- Repository: https://github.com/ycluis/fullstackopen

## Overview

##### Main Components
- Projects by “part” (for example, part1, part2, up to part7). Each “part” addresses a specific exercise or set of exercises.
- For individual projects that are full-stack (such as bloglist or phonebook in certain parts), clearly identify the separation between frontend and backend components:
- Frontend – typically implemented with React (directories like “src”, “public”, and various components, services, and styles).
- Backend – built with Node/Express (files like app.js, index.js, controllers, models, and middleware along with configuration files).
- Supporting infrastructure elements like databases (e.g., when a project uses a db.json file or MongoDB connection hints in projects like part3 phonebook) and containerization (Dockerfiles in part3).

##### Relationships and Interactions
- For full-stack projects, illustrate the data flow from the React client (frontend) through the REST API layer (backend controllers) to the database or persistence layer.
- The client user interface (React components),
- API endpoints (Express routes and controllers),
- Data layers (simulated databases using JSON files or actual databases when using MongoDB).
- Middleware components that handle authentication, error handling, or token management.
- For projects with Redux or Context API, show internal state flow inside the frontend component bubble.

##### Architectural Patterns and Design Principles
- Many projects follow the standard separation of concerns into MVC-like patterns (with views in React, controllers handling the API endpoints, and models managing data).
- Some projects illustrate a clear microservice pattern (separate backend and frontend codebases even if in the same repository).
- Components with tests, configuration files (e.g., ESLint, environment samples), and Docker setups must be noted as they show attention to quality, deployment, and environment consistency.
- State management patterns (Redux vs. Context) in the projects under part6 and part7.

##### Relevant Technologies and Frameworks
- Frontend: React, Redux, and various testing frameworks (e.g., Cypress for e2e tests) as well as CSS styling.
- Backend: Node.js and Express (with clearly organized controllers, routes, and middleware).
- Deployment/DevOps: Docker (part3), environment configuration files, and code style tools (ESLint).
- Supplementary aspects include utilities, services (for making HTTP calls), and configuration management in certain projects.

- A general container for each “part” (e.g., part1, part2, part3, etc.).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Part1: React Apps
    subgraph "Part1: React Apps"
        p1Anecdotes["Anecdotes (React)"]:::front
        p1Course["Course Info (React)"]:::front
        p1Unicafe["Unicafe (React)"]:::front
    end

    %% Part2: Mixed React and Simulated Backend
    subgraph "Part2"
        p2Course["Course Info (React)"]:::front
        p2PhonebookFront["Phonebook Frontend (React)"]:::front
        p2PhonebookBack["Simulated Backend (JSON)"]:::back
        p2Restcountries["Restcountries (React)"]:::front
    end

    %% Part3: Phonebook Full‑Stack with Node/Express, Docker & MongoDB
    subgraph "Part3: Phonebook Full‑Stack"
        p3PhonebookFront["Phonebook Frontend (React)"]:::front
        p3PhonebookBack["Phonebook Backend (Node/Express)"]:::back
        p3Database["Database (MongoDB/Docker)"]:::db
    end

    %% Bloglist Full‑Stack (Parts4 & 5)
    subgraph "Bloglist Full‑Stack (Parts4 & 5)"
        bloglistBackend["Bloglist Backend (Express)"]:::back
        bloglistFrontend["Bloglist Frontend (React)"]:::front
    end

    %% Part6: State Management Variants
    subgraph "Part6"
        p6AnecdotesQuery["Anecdotes App (Query Context)"]:::front
        p6AnecdotesRedux["Anecdotes App (Redux)"]:::front
        p6UnicafeRedux["Unicafe App (Redux)"]:::front
    end

    %% Part7: Advanced Routing and Hooks
    subgraph "Part7"
        p7AnecdotesRouting["Anecdotes App with Routing (React)"]:::front
        p7BloglistBackend["Bloglist Backend (Express)"]:::back
        p7BloglistFrontend["Bloglist Frontend (React)"]:::front
        p7Country["Country App (Hooks)"]:::front
        p7UltimateHooks["Ultimate Hooks Project (React)"]:::front
    end

    %% Relationships for full‑stack projects
    p2PhonebookFront -->|"JSON-call"| p2PhonebookBack
    p3PhonebookFront -->|"HTTP-request"| p3PhonebookBack
    p3PhonebookBack -->|"DB-query"| p3Database
    bloglistFrontend -->|"REST-API"| bloglistBackend
    p7BloglistFrontend -->|"REST-API"| p7BloglistBackend

    %% Click Events
    click p1Anecdotes "https://github.com/ycluis/fullstackopen/tree/master/part1/anecdotes"
    click p1Course "https://github.com/ycluis/fullstackopen/tree/master/part1/courseinfo"
    click p1Unicafe "https://github.com/ycluis/fullstackopen/tree/master/part1/unicafe"

    click p2Course "https://github.com/ycluis/fullstackopen/tree/master/part2/courseinfo"
    click p2PhonebookFront "https://github.com/ycluis/fullstackopen/tree/master/part2/phonebook"
    click p2PhonebookBack "https://github.com/ycluis/fullstackopen/tree/master/part2/phonebook"
    click p2Restcountries "https://github.com/ycluis/fullstackopen/tree/master/part2/restcountries"

    click p3PhonebookBack "https://github.com/ycluis/fullstackopen/tree/master/part3/phonebook"

    click bloglistBackend "https://github.com/ycluis/fullstackopen/tree/master/part4/bloglist"
    click bloglistFrontend "https://github.com/ycluis/fullstackopen/tree/master/part5/bloglist-frontend"

    click p6AnecdotesQuery "https://github.com/ycluis/fullstackopen/tree/master/part6/anecdotes-query"
    click p6AnecdotesRedux "https://github.com/ycluis/fullstackopen/tree/master/part6/anecdotes-redux"
    click p6UnicafeRedux "https://github.com/ycluis/fullstackopen/tree/master/part6/unicafe-redux"

    click p7AnecdotesRouting "https://github.com/ycluis/fullstackopen/tree/master/part7/anecdotes-routed"
    click p7BloglistBackend "https://github.com/ycluis/fullstackopen/tree/master/part7/bloglist/backend"
    click p7BloglistFrontend "https://github.com/ycluis/fullstackopen/tree/master/part7/bloglist/frontend"
    click p7Country "https://github.com/ycluis/fullstackopen/tree/master/part7/country-hook"
    click p7UltimateHooks "https://github.com/ycluis/fullstackopen/tree/master/part7/ultimate-hooks"

    %% Styles
    classDef front fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef back fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef db fill:#FFECB3,stroke:#FF6F00,stroke-width:2px;
    classDef container fill:#FFF9C4,stroke:#FBC02D,stroke-width:2px;
```
