# simplepotato01/simple_pets architecture

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

- Interactive diagram: https://gitdiagram.com/simplepotato01/simple_pets
- Repository: https://github.com/simplepotato01/simple_pets

## Overview

This repository is a portfolio of independent networking, operating-system, C++ and security projects, not one integrated application. Its principal user workflows are project-specific: network peers exchange data with a service, OS utilities operate on memory or files, and C++ examples exercise a library or pattern. The graph preserves the README’s major projects as separate branches. Source evidence is limited to the supplied excerpts and index; for unsampled projects, paths identify their implementation files or directories, but no runtime connections are inferred.

Main entry points: [`c/networks/practic/snake_online/server.c`](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/snake_online/server.c) (Snake server), [`c/os/my_malloc/heap.c`](https://github.com/simplepotato01/simple_pets/blob/main/c/os/my_malloc/heap.c) (Custom allocator), [`cpp/my_coroutine/include/generator.hpp`](https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_coroutine/include/generator.hpp) (Generator), [`cpp/patterns/builder/main.cpp`](https://github.com/simplepotato01/simple_pets/blob/main/cpp/patterns/builder/main.cpp) (Builder example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_net["Networking"]
  node_domain_sockets["Unix sockets"]
  node_tcp_echo["TCP echo"]
  node_epoll_echo["Epoll echo"]
  node_udp_echo["UDP echo"]
  node_dns_proxy["DNS cache proxy<br/>[main.c]"]
  node_vlan_bridge["VLAN STP bridge<br/>[main.c]"]
  node_click_router["Click router<br/>[main.c]"]
  node_micro_tcp["Micro TCP stack<br/>[main.c]"]
  node_file_transfer["TCP file transfer"]
  node_multicast["UDP discovery<br/>[main.c]"]
  node_snake_client["Snake client<br/>[client.c]"]
  node_snake_server["Snake server<br/>[server.c]"]
  node_snake_protocol["Game state types<br/>[common.h]"]
  node_dhcp["DHCP snooping<br/>[main.c]"]
  node_arp_bridge["ARP MAC bridge"]
  node_beacon["Beacon analyzer<br/>[main.c]"]
  node_mac_sniffer["MAC sniffer<br/>[mac_sniffer.c]"]
  node_raw_sniffer["Raw sniffer<br/>[raw_sniffer.c]"]
  node_wifi_sniffer["Wi-Fi sniffer<br/>[main.c]"]
end

subgraph group_os["Operating Systems"]
  node_vfs1["VFS exercise 1"]
  node_vfs2["VFS exercise 2"]
  node_custom_heap["Custom allocator<br/>[heap.c]"]
  node_strace["Syscall tracer<br/>[main.c]"]
  node_custom_syscall["Custom syscall"]
  node_pagemap["Page map reader<br/>[main.c]"]
  node_char_module["Character device<br/>[chardev.c]"]
  node_hello_module["Hello kernel module<br/>[hello.c]"]
end

subgraph group_cpp["C++ Utilities"]
  node_coroutine_demo["Coroutine demo<br/>[main.cpp]"]
  node_generator["Generator<br/>[generator.hpp]"]
  node_stack_pool["Coroutine stack pool<br/>[pool_allocator.hpp]"]
  node_small_string["Small string<br/>[small_string.cpp]"]
  node_string_allocator["String pool allocator<br/>[pool_allocator.cpp]"]
end

subgraph group_patterns["Design Patterns"]
  node_builder["Builder example<br/>[main.cpp]"]
end

subgraph group_sec["Security Analysis"]
end

node_peer(("Network peers"))

node_peer -->|"connects"| node_snake_server
node_snake_server -->|"sends game state"| node_peer
node_snake_server -->|"uses shared types"| node_snake_protocol
node_coroutine_demo -->|"constructs"| node_generator
node_generator -->|"allocates stacks"| node_stack_pool
node_custom_heap -->|"allocates and frees"| node_custom_heap
node_builder -.->|"demonstrates pattern"| node_builder

click node_domain_sockets "https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/domain_sockets"
click node_tcp_echo "https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/tcp"
click node_epoll_echo "https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/tcp_but_with_epoll"
click node_udp_echo "https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/udp"
click node_dns_proxy "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/DNS_cache_proxy/main.c"
click node_vlan_bridge "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/VLAN_aware_bridge_with_STP/main.c"
click node_click_router "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/click_router/main.c"
click node_micro_tcp "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/micro_TCP_stack/main.c"
click node_file_transfer "https://github.com/simplepotato01/simple_pets/tree/main/c/networks/practic/TCP_file_transfer_with_speedtest"
click node_multicast "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/UDP_multicast_discovery/main.c"
click node_snake_client "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/snake_online/client.c"
click node_snake_server "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/snake_online/server.c"
click node_snake_protocol "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/snake_online/common.h"
click node_dhcp "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/DHCP_snooping/main.c"
click node_arp_bridge "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/arp_and_mac_bridge/arp_and_mac_bridge.c"
click node_beacon "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/beacon_frame_analyzer/main.c"
click node_mac_sniffer "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/mac_sniffer/mac_sniffer.c"
click node_raw_sniffer "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/raw_sniffer/raw_sniffer.c"
click node_wifi_sniffer "https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/wifi_sniffer/main.c"
click node_vfs1 "https://github.com/simplepotato01/simple_pets/tree/main/c/os/VFS1"
click node_vfs2 "https://github.com/simplepotato01/simple_pets/tree/main/c/os/VFS2"
click node_custom_heap "https://github.com/simplepotato01/simple_pets/blob/main/c/os/my_malloc/heap.c"
click node_strace "https://github.com/simplepotato01/simple_pets/blob/main/c/os/my_strace/main.c"
click node_custom_syscall "https://github.com/simplepotato01/simple_pets/tree/main/c/os/my_syscall"
click node_pagemap "https://github.com/simplepotato01/simple_pets/blob/main/c/os/read_pagemap/main.c"
click node_char_module "https://github.com/simplepotato01/simple_pets/blob/main/c/os/kernel_modules/chardev/chardev.c"
click node_hello_module "https://github.com/simplepotato01/simple_pets/blob/main/c/os/kernel_modules/hello_module/hello.c"
click node_coroutine_demo "https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_coroutine/src/main.cpp"
click node_generator "https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_coroutine/include/generator.hpp"
click node_stack_pool "https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_coroutine/include/pool_allocator.hpp"
click node_small_string "https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_small_string/src/small_string.cpp"
click node_string_allocator "https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_small_string/src/pool_allocator.cpp"
click node_builder "https://github.com/simplepotato01/simple_pets/blob/main/cpp/patterns/builder/main.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_domain_sockets,node_tcp_echo,node_epoll_echo,node_udp_echo,node_dns_proxy,node_vlan_bridge,node_click_router,node_micro_tcp,node_file_transfer,node_multicast,node_snake_client,node_snake_server,node_snake_protocol,node_dhcp,node_arp_bridge,node_beacon,node_mac_sniffer,node_raw_sniffer,node_wifi_sniffer toneBlue
class node_vfs1,node_vfs2,node_custom_heap,node_strace,node_custom_syscall,node_pagemap,node_char_module,node_hello_module toneAmber
class node_coroutine_demo,node_generator,node_stack_pool,node_small_string,node_string_allocator toneMint
class node_builder toneRose
class node_peer toneIndigo
```

## Components

### Networking

- [Unix sockets](https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/domain_sockets): `c/networks/echo_services/domain_sockets`
- [TCP echo](https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/tcp): `c/networks/echo_services/tcp`
- [Epoll echo](https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/tcp_but_with_epoll): `c/networks/echo_services/tcp_but_with_epoll`
- [UDP echo](https://github.com/simplepotato01/simple_pets/tree/main/c/networks/echo_services/udp): `c/networks/echo_services/udp`
- [DNS cache proxy](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/DNS_cache_proxy/main.c): `c/networks/magnum_opus/DNS_cache_proxy/main.c`
- [VLAN STP bridge](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/VLAN_aware_bridge_with_STP/main.c): `c/networks/magnum_opus/VLAN_aware_bridge_with_STP/main.c`
- [Click router](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/click_router/main.c): `c/networks/magnum_opus/click_router/main.c`
- [Micro TCP stack](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/magnum_opus/micro_TCP_stack/main.c): `c/networks/magnum_opus/micro_TCP_stack/main.c`
- [TCP file transfer](https://github.com/simplepotato01/simple_pets/tree/main/c/networks/practic/TCP_file_transfer_with_speedtest): `c/networks/practic/TCP_file_transfer_with_speedtest`
- [UDP discovery](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/UDP_multicast_discovery/main.c): `c/networks/practic/UDP_multicast_discovery/main.c`
- [Snake client](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/snake_online/client.c): `c/networks/practic/snake_online/client.c`
- [Snake server](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/snake_online/server.c): `c/networks/practic/snake_online/server.c`
- [Game state types](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/practic/snake_online/common.h): `c/networks/practic/snake_online/common.h`
- [DHCP snooping](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/DHCP_snooping/main.c): `c/networks/raw_sockets/DHCP_snooping/main.c`
- [ARP MAC bridge](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/arp_and_mac_bridge/arp_and_mac_bridge.c): `c/networks/raw_sockets/arp_and_mac_bridge/arp_and_mac_bridge.c`
- [Beacon analyzer](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/beacon_frame_analyzer/main.c): `c/networks/raw_sockets/beacon_frame_analyzer/main.c`
- [MAC sniffer](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/mac_sniffer/mac_sniffer.c): `c/networks/raw_sockets/mac_sniffer/mac_sniffer.c`
- [Raw sniffer](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/raw_sniffer/raw_sniffer.c): `c/networks/raw_sockets/raw_sniffer/raw_sniffer.c`
- [Wi-Fi sniffer](https://github.com/simplepotato01/simple_pets/blob/main/c/networks/raw_sockets/wifi_sniffer/main.c): `c/networks/raw_sockets/wifi_sniffer/main.c`

### Operating Systems

- [VFS exercise 1](https://github.com/simplepotato01/simple_pets/tree/main/c/os/VFS1): `c/os/VFS1`
- [VFS exercise 2](https://github.com/simplepotato01/simple_pets/tree/main/c/os/VFS2): `c/os/VFS2`
- [Custom allocator](https://github.com/simplepotato01/simple_pets/blob/main/c/os/my_malloc/heap.c): `c/os/my_malloc/heap.c`
- [Syscall tracer](https://github.com/simplepotato01/simple_pets/blob/main/c/os/my_strace/main.c): `c/os/my_strace/main.c`
- [Custom syscall](https://github.com/simplepotato01/simple_pets/tree/main/c/os/my_syscall): `c/os/my_syscall`
- [Page map reader](https://github.com/simplepotato01/simple_pets/blob/main/c/os/read_pagemap/main.c): `c/os/read_pagemap/main.c`
- [Character device](https://github.com/simplepotato01/simple_pets/blob/main/c/os/kernel_modules/chardev/chardev.c): `c/os/kernel_modules/chardev/chardev.c`
- [Hello kernel module](https://github.com/simplepotato01/simple_pets/blob/main/c/os/kernel_modules/hello_module/hello.c): `c/os/kernel_modules/hello_module/hello.c`

### C++ Utilities

- [Coroutine demo](https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_coroutine/src/main.cpp): `cpp/my_coroutine/src/main.cpp`
- [Generator](https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_coroutine/include/generator.hpp): `cpp/my_coroutine/include/generator.hpp`
- [Coroutine stack pool](https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_coroutine/include/pool_allocator.hpp): `cpp/my_coroutine/include/pool_allocator.hpp`
- [Small string](https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_small_string/src/small_string.cpp): `cpp/my_small_string/src/small_string.cpp`
- [String pool allocator](https://github.com/simplepotato01/simple_pets/blob/main/cpp/my_small_string/src/pool_allocator.cpp): `cpp/my_small_string/src/pool_allocator.cpp`

### Design Patterns

- [Builder example](https://github.com/simplepotato01/simple_pets/blob/main/cpp/patterns/builder/main.cpp): `cpp/patterns/builder/main.cpp`

### Other components

- **Network peers**

## Connections

- Network peers → Snake server: connects (evidence: `c/networks/practic/snake_online/server.c`)
- Snake server → Network peers: sends game state (evidence: `c/networks/practic/snake_online/server.c`)
- Snake server → Game state types: uses shared types (evidence: `c/networks/practic/snake_online/server.c`)
- Coroutine demo → Generator: constructs (evidence: `cpp/my_coroutine/src/main.cpp`)
- Generator → Coroutine stack pool: allocates stacks (evidence: `cpp/my_coroutine/include/generator.hpp`)
- Custom allocator → Custom allocator: allocates and frees
- Builder example → Builder example: demonstrates pattern (evidence: `cpp/patterns/builder/main.cpp`)
