# soham2402/experiments architecture

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

- Interactive diagram: https://gitdiagram.com/soham2402/experiments
- Repository: https://github.com/soham2402/experiments

## Overview

This repository is a sandbox containing a Bloom-filter visualization, a Go in-memory cache, and an early Go TCP server experiment. In the demo, a user enters a username; the app hashes it to candidate bits, saves it by setting those bits, and can display saved names. The cache exposes get/set/delete operations with TTL expiration and a background cleanup worker; a sample program exercises its API. The server currently creates a TCP socket, while binding and listening remain commented out. Arrows reflect excerpted code or README statements; unsampled cache loader details are not inferred.

Main entry points: [`bloomfilter/src/App.tsx`](https://github.com/soham2402/experiments/blob/main/bloomfilter/src/App.tsx) (Bloom App), [`stewcache/pkg/stew/options.go`](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/options.go) (Cache Store), [`stewcache/main.go`](https://github.com/soham2402/experiments/blob/main/stewcache/main.go) (Cache Example), [`stewcache/pkg/stew/api.go`](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/api.go) (Cache API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bloom["Bloom Filter Demo"]
  node_bloom_app["Bloom App<br/>[App.tsx]"]
  node_search_bar["Username Input<br/>[search.tsx]"]
  node_bit_grid["Bit Grid<br/>[BinaryGrid.tsx]"]
  node_bloom_mount["React Mount<br/>[main.tsx]"]
end

subgraph group_cache["In-Memory Cache"]
  node_cache_example["Cache Example<br/>[main.go]"]
  node_cache_api["Cache API<br/>[api.go]"]
  node_cache_store[("Cache Store<br/>[options.go]")]
  node_cache_lifecycle["Cache Lifecycle<br/>[stew.go]"]
  node_cache_cleaner["TTL Cleaner<br/>[cleaners.go]"]
  node_cache_config["Cache Configuration<br/>[config.go]"]
  node_cache_loader["Loader Function<br/>[func.go]"]
end

subgraph group_server["TCP Server Experiment"]
  node_server_start["Socket Startup<br/>[main.go]"]
end

node_demo_user(("Demo User"))
node_os_network["OS Networking"]

node_demo_user -->|"uses"| node_bloom_app
node_bloom_mount -->|"renders"| node_bloom_app
node_bloom_app -->|"renders"| node_search_bar
node_bloom_app -->|"renders"| node_bit_grid
node_cache_example -->|"creates"| node_cache_lifecycle
node_cache_example -->|"calls"| node_cache_api
node_cache_api -->|"reads/writes"| node_cache_store
node_cache_lifecycle -->|"starts"| node_cache_cleaner
node_cache_cleaner -->|"removes expired"| node_cache_store
node_cache_config -.->|"configures"| node_cache_store
node_server_start -->|"creates socket"| node_os_network

click node_bloom_app "https://github.com/soham2402/experiments/blob/main/bloomfilter/src/App.tsx"
click node_search_bar "https://github.com/soham2402/experiments/blob/main/bloomfilter/src/components/search.tsx"
click node_bit_grid "https://github.com/soham2402/experiments/blob/main/bloomfilter/src/components/BinaryGrid.tsx"
click node_bloom_mount "https://github.com/soham2402/experiments/blob/main/bloomfilter/src/main.tsx"
click node_cache_example "https://github.com/soham2402/experiments/blob/main/stewcache/main.go"
click node_cache_api "https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/api.go"
click node_cache_store "https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/options.go"
click node_cache_lifecycle "https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/stew.go"
click node_cache_cleaner "https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/cleaners.go"
click node_cache_config "https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/config.go"
click node_cache_loader "https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/func.go"
click node_server_start "https://github.com/soham2402/experiments/blob/main/servit/main.go"

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_bloom_app,node_search_bar,node_bit_grid,node_bloom_mount,node_demo_user toneBlue
class node_cache_example,node_cache_api,node_cache_store,node_cache_lifecycle,node_cache_cleaner,node_cache_config,node_cache_loader toneAmber
class node_server_start toneMint
class node_os_network toneIndigo
```

## Components

### Bloom Filter Demo

- [Bloom App](https://github.com/soham2402/experiments/blob/main/bloomfilter/src/App.tsx): `bloomfilter/src/App.tsx`
- [Username Input](https://github.com/soham2402/experiments/blob/main/bloomfilter/src/components/search.tsx): `bloomfilter/src/components/search.tsx`
- [Bit Grid](https://github.com/soham2402/experiments/blob/main/bloomfilter/src/components/BinaryGrid.tsx): `bloomfilter/src/components/BinaryGrid.tsx`
- [React Mount](https://github.com/soham2402/experiments/blob/main/bloomfilter/src/main.tsx): `bloomfilter/src/main.tsx`

### In-Memory Cache

- [Cache Example](https://github.com/soham2402/experiments/blob/main/stewcache/main.go): `stewcache/main.go`
- [Cache API](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/api.go): `stewcache/pkg/stew/api.go`
- [Cache Store](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/options.go): `stewcache/pkg/stew/options.go`
- [Cache Lifecycle](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/stew.go): `stewcache/pkg/stew/stew.go`
- [TTL Cleaner](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/cleaners.go): `stewcache/pkg/stew/cleaners.go`
- [Cache Configuration](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/config.go): `stewcache/pkg/stew/config.go`
- [Loader Function](https://github.com/soham2402/experiments/blob/main/stewcache/pkg/stew/func.go): `stewcache/pkg/stew/func.go`

### TCP Server Experiment

- [Socket Startup](https://github.com/soham2402/experiments/blob/main/servit/main.go): `servit/main.go`

### Other components

- **Demo User**
- **OS Networking**

## Connections

- Demo User → Bloom App: uses (evidence: `readme.md`)
- React Mount → Bloom App: renders (evidence: `bloomfilter/src/main.tsx`)
- Bloom App → Username Input: renders (evidence: `bloomfilter/src/App.tsx`)
- Bloom App → Bit Grid: renders (evidence: `bloomfilter/src/App.tsx`)
- Cache Example → Cache Lifecycle: creates (evidence: `stewcache/main.go`)
- Cache Example → Cache API: calls (evidence: `stewcache/main.go`)
- Cache API → Cache Store: reads/writes (evidence: `stewcache/pkg/stew/api.go`)
- Cache Lifecycle → TTL Cleaner: starts (evidence: `stewcache/pkg/stew/stew.go`)
- TTL Cleaner → Cache Store: removes expired (evidence: `stewcache/pkg/stew/cleaners.go`)
- Cache Configuration → Cache Store: configures
- Socket Startup → OS Networking: creates socket (evidence: `servit/main.go`)
