Console Routes & Endpoints
Complete reference for all Flask routes in Nexus Console.
Authentication Routes
GET /login
Purpose: Display login form
Template: login.html
Auth: Public
POST /login
Purpose: Process login (username + PIN)
Parameters:
- username - User's username
- pin - 4-digit PIN
Redis: Checks user:{username} in User environment
Session: Sets user_id and username
Redirects: To / or ?next parameter
GET /logout
Purpose: Clear session and logout
Action: session.clear()
Redirects: To /login
Main Routes
GET /
Purpose: Console home
Action: Redirects to /track
Auth: Public (will redirect to Track which may require auth)
Track Routes
GET /track
Purpose: Projects list grouped by status
Template: track/projects.html
Redis: Track environment (6640/6641)
Query Params:
- status - Filter by status (active, paused, completed, cancelled)
Data:
- Reads all projects from track:{user}:projects set
- Counts tasks per project
- Calculates progress percentage
- Groups by status
GET /track/project/<project_id>
Purpose: Single project detail with tasks
Template: track/project_detail.html
Redis: Track environment
Data:
- Project details from track:{user}:*:project:{project_id}
- All tasks where parent_project == project_id
- Task completion count and progress
KB Routes
GET /kb
Purpose: KB roots list with category filtering
Template: kb/list.html
Redis: KB environment (6625/6626)
Query Params:
- category - Filter by category (infrastructure, training, etc.)
Categories:
- infrastructure, training, operations, projects, documentation, marketing
Data:
- All roots from kb:{user}:roots set
- Child count per root
- Category counts
GET /kb/<kb_id>
Purpose: KB tree view for a root
Template: kb/tree.html
Data:
- Recursive tree structure using build_kb_tree()
- Shows all sections and pages nested
GET /kb/node/<node_id>
Purpose: Single KB node detail
Template: kb/node.html
Data:
- Node content (Markdown rendered)
- Breadcrumb path
- Children list
- Node metadata
GET /kb/search
Purpose: Search KB articles
Template: kb/search.html
Query Params:
- q - Search query
Search:
- Searches title, content, and description
- Limit 50 results
Session Routes
GET /sessions
Purpose: Sessions list (current + historical)
Template: sessions/list.html
Redis: Session environment (6645/6646)
Data:
- Current session from sess:current:{user}
- All sessions matching patterns:
- sess:s_* (new stable ID pattern)
- sess:{user}:20* (legacy timestamp pattern)
- Filters to user's sessions
- Limit 50 historical sessions
GET /sessions/<session_id>
Purpose: Single session detail
Template: sessions/detail.html
Data:
- Session info
- Objectives list
- Work items from session:{user}:{session_id}:items
Notes Routes
GET /notes
Purpose: User notes list from Context environment
Template: notes/list.html
Redis: Context environment (6620/6621)
Data:
- All notes matching ctxt:*:NOTE:*
- Excludes embedding and timestamp sub-keys
- Limit 100 recent notes
- Includes voice notes and user ideas
Chrono Routes
GET /chrono
Purpose: Calendar and reminders
Template: chrono/list.html
Redis: Chrono environment (6680/6681)
Data:
- Reminders from chrono:{user}:reminder:*
- Filter upcoming (not dismissed)
- Limit 20
Search Routes
GET /search
Purpose: Global search across environments
Template: search.html
Query Params:
- q - Search query
- env - Environment filter (all, kb, track)
Searches:
- KB: Nodes matching query (limit 10)
- Track: Projects matching query (limit 10)
Returns: Results grouped by environment
Contact Routes
GET /contacts
Purpose: CRM contacts list
Template: contacts/list.html
Redis: Contact environment (6630/6631)
Query Params:
- category - Filter by category
Categories:
- client, partner, vendor, investor, lead, personal
Patterns:
- New: contact:system:*:contact:c_*
- Legacy: contact:{user}:*
GET /contacts/<contact_id>
Purpose: Single contact detail
Template: contacts/detail.html
Data:
- Contact information
- Company, email, phone
- Category and notes
API Routes
POST /api/notes/create
Purpose: Create a new note Redis: Context vault (6620) Body (JSON):
{
"title": "Note title",
"content": "Note content",
"tags": ["tag1", "tag2"]
}
Returns: {"success": true, "note_id": "n_xxxx"}
POST /api/contacts/create
Purpose: Create a new contact Redis: Contact vault (6630) Body (JSON):
{
"firstName": "John",
"lastName": "Doe",
"company": "Acme Inc",
"email": "john@acme.com",
"phone": "555-1234",
"category": "client"
}
Returns: {"success": true, "contact_id": "c_xxxx"}
DELETE /api/contacts/delete/<contact_id>
Purpose: Delete a contact
Auth: Checks owner matches user
Returns: {"success": true}
POST /api/calendar/create
Purpose: Create calendar event Redis: Chrono vault (6680) Body (JSON):
{
"title": "Meeting",
"date": "2026-01-15",
"time": "14:00",
"location": "Conference Room",
"description": "Q1 Planning"
}
Returns: {"success": true, "event_id": "e_xxxx"}
GET /api/calendar/events
Purpose: Calendar events in FullCalendar JSON format Redis: Chrono operational (6681) Returns: Array of event objects
[
{
"id": "e_abc123",
"title": "Meeting",
"start": "2026-01-15T14:00:00",
"backgroundColor": "#FF9800"
}
]
POST /api/track/project/<project_id>/status
Purpose: Update project status Redis: Track vault (6640) Body (JSON):
{
"status": "paused"
}
Valid statuses: active, paused, completed, cancelled
Returns: {"success": true, "status": "paused"}
POST /api/track/task/<task_id>/status
Purpose: Update task status Redis: Track vault (6640) Body (JSON):
{
"status": "completed"
}
Valid statuses: pending, active, in_progress, completed
Returns: {"success": true, "status": "completed"}
Error Handlers
404 Not Found
Template: error.html
Message: "Page not found"
500 Server Error
Template: error.html
Message: "Server error"
Helper Functions
find_node_key(r, user, node_id)
Finds KB node key handling timestamp variations
Pattern: kb:{user}:*:node:{node_id}
get_kb_node(r, user, node_id)
Gets a KB node by ID, returns parsed JSON
get_kb_children(r, user, node_id)
Gets children of a KB node, sorted by order
Key: kb:{user}:node:{node_id}:children
build_kb_tree(r, user, node_id, max_depth=10)
Recursively builds tree structure for KB Returns: Nested dict with children
get_kb_breadcrumb(r, user, node_id)
Builds breadcrumb path from node to root Returns: List of {id, title, type} dicts
get_current_user()
Gets current user from session or default
Fallback: DEFAULT_USER = 'u_z1p5'