How nanda2708/trie-connect works
TrieConnect is a contact search app: users search by name-word or phone prefix, inspect the matching trie path and results, and can create, edit, or delete contacts. The API validates and coordinates contact records in MongoDB or memory with a separate C++ trie process; it also exposes trie stats and a trie-versus-linear benchmark. The React UI consumes those API capabilities. Relationships are grounded in the README or shown source excerpts; the store implementation and some UI components are not sampled, so their internal behavior is not expanded.
Main entry points: App.tsx Search and manage · api.ts API client · index.js HTTP routes · store.js Contact storage
Components 15
React interface
- Search and manage
frontend/src/App.tsx - API client
frontend/src/api.ts - Contact form
frontend/src/components/ContactForm.tsx - Contact list
frontend/src/components/ContactList.tsx - Trie path view
frontend/src/components/TriePath.tsx - Benchmark panel
frontend/src/components/BenchmarkPanel.tsx
Express API
- HTTP routes
server/src/index.js
Search index
- Key mapping and search
server/src/searchIndex.js - Engine process bridge
server/src/engine.js
C++ engine
- Prefix trie
cpp/Trie.cpp - Command and benchmark handling
cpp/main.cpp
Contact records
- Contact storage
server/src/store.js
Other components
- Contact user
- MongoDB
- In-memory records
Connections 19
- Contact user → Search and manage: searches and edits
README.md - Search and manage → API client: requests data
frontend/src/App.tsx - Search and manage → Contact form: renders
frontend/src/App.tsx - Search and manage → Contact list: renders
frontend/src/App.tsx - Search and manage → Trie path view: renders
frontend/src/App.tsx - Search and manage → Benchmark panel: renders
frontend/src/App.tsx - Contact form → API client: saves via callback
frontend/src/App.tsx - API client → HTTP routes: HTTP requests
README.md - HTTP routes → Key mapping and search: searches and updates
server/src/index.js - HTTP routes → Contact storage: reads and writes
server/src/index.js - HTTP routes → Engine process bridge: requests stats and benchmark
server/src/index.js - Key mapping and search → Engine process bridge: sends trie commands
server/src/searchIndex.js - Engine process bridge → Command and benchmark handling: stdin and stdout
server/src/engine.js - Command and benchmark handling → Prefix trie: executes trie operations
cpp/main.cpp - Contact storage → MongoDB: optional persistence
README.md - Contact storage → In-memory records: fallback storage
README.md - Benchmark panel → API client: requests benchmark
frontend/src/components/BenchmarkPanel.tsx - Search and manage → API client: loads walk and stats
frontend/src/App.tsx - Trie path view → Search and manage: displays walk data
frontend/src/App.tsx