How markbmag/ncode works
Ncode is a web app for searching text across connected relational databases. A user signs in, selects a connection and search scope, submits a phrase, follows task progress, and views highlighted matching rows or exports them. The backend also manages connections, user permissions, sessions, and search auditing. The graph preserves documented connection management, table scoping, CSV export, and team features; some backend internals are represented at module level because their source was not excerpted.
Main entry points: Workspace.tsx Workspace · api.py API routes · useSearch.ts Search progress · api.ts HTTP and session client
Components 20
Web workspace
- Session gate
frontend/src/App.tsx - Login
frontend/src/Login.tsx - Workspace
frontend/src/Workspace.tsx - Connection editor
frontend/src/components/ConnectionModal.tsx - Search scope
frontend/src/components/ScopeModal.tsx - Search controls
frontend/src/components/SearchBar.tsx - Search progress
frontend/src/hooks/useSearch.ts - Results and export
frontend/src/components/ResultsPanel.tsx - Match highlighting
frontend/src/components/Highlight.tsx - HTTP and session client
frontend/src/api.ts
API and access
- API routes
backend/app/api.py - Authentication
backend/app/security.py
Search runtime
- Database search
backend/app/search.py - Search tasks
backend/app/tasks.py - Database access
backend/app/db.py
Configuration and state
- Connection registry
backend/app/config.py - Users, sessions, audit
backend/app/appdb.py - Credential encryption
backend/app/crypto.py
Other components
- User
- Connected databases
Connections 27
- User → Session gate: opens
- Session gate → Login: prompts
frontend/src/App.tsx - Session gate → Workspace: shows
frontend/src/App.tsx - Login → HTTP and session client: authenticates via
frontend/src/Login.tsx - Workspace → HTTP and session client: loads and manages
frontend/src/Workspace.tsx - Workspace → Connection editor: opens
frontend/src/Workspace.tsx - Workspace → Search scope: opens
frontend/src/Workspace.tsx - Workspace → Search controls: renders
frontend/src/Workspace.tsx - Workspace → Search progress: starts and tracks
frontend/src/Workspace.tsx - Workspace → Results and export: renders
frontend/src/Workspace.tsx - Search controls → Search progress: submits parameters
frontend/src/Workspace.tsx - Search progress → HTTP and session client: starts and cancels
frontend/src/hooks/useSearch.ts - Search progress → API routes: opens task socket
- Results and export → Match highlighting: renders matches
frontend/src/components/ResultsPanel.tsx - Results and export → User: exports CSV
- HTTP and session client → API routes: sends API requests
frontend/src/api.ts - API routes → Authentication: checks access
backend/app/api.py - API routes → Users, sessions, audit: reads and writes
backend/app/api.py - API routes → Connection registry: loads connection settings
backend/app/api.py - API routes → Search tasks: creates and serves tasks
backend/app/api.py - API routes → Database search: dispatches searches
backend/app/api.py - Database search → Database access: queries tables
backend/app/search.py - Database search → Search tasks: updates progress and results
backend/app/search.py - Database access → Connected databases: connects and reads
- Users, sessions, audit → Credential encryption: encrypts credentials
backend/app/appdb.py - Users, sessions, audit → User: stores access and audit records
- Connection registry → Connected databases: defines connections