Instructions for Adding Duplicate Route with Dashboard Table Display
Overview
Create a duplicate route that serves the same functionality as an existing
route, then update the dashboard to display both routes in a clean comparison
table format.
Step 1: Analyze Existing Route Structure
Check main router (/main.tsx) to understand current routing setup
Identify the existing route in /backend/routes/views/_views.routes.ts
Locate the controller that handles the route functionality
Note the authentication middleware applied to the existing route
Locate the dashboard file at /backend/routes/views/dashboard.tsx
Find the section that displays glimpse links (look for demo pages
display)
Replace the existing link display with a three-column table:
Column 1: "Name" (30% width) - shows page title with emoji
Column 2: "Original Route" (35% width) - shows /views/glimpse/{:id} as
clickable link
Column 3: "New Shortcut Route" (35% width) - shows /glimpse/{:id} as
clickable link
Style the table with:
Clean borders and spacing
Header row with background color
Different link colors (blue for original, green for new)
Monospace font for route paths
Proper vertical alignment
Step 5: Implementation Details
Route File Template (_glimpse.routes.ts):
import { Hono } from "npm:hono@3.12.12";
import { glimpseHandler } from "../../controllers/glimpse.controller.ts";
const app = new Hono();
app.get("/:id", glimpseHandler);
export default app;
Main Router Updates:
Import:
import glimpseRoutes from "./backend/routes/glimpse/_glimpse.routes.ts";
Auth: app.use("/glimpse/*", authCheck);
Mount: app.route("/glimpse", glimpseRoutes);
Dashboard Table Structure:
Three columns with clear headers
Page name in first column (no repetition)
Both route formats as clickable links
Consistent styling and spacing
Color coding for route types
Step 6: Testing
Test both routes return identical responses (login page if not
authenticated)
Verify table display shows all demo pages with both route formats
Confirm links work and open in new tabs
Check responsive layout and readability
Key Principles
No code duplication - reuse existing controller
Consistent authentication - same middleware for both routes
Clean architecture - maintain separation between router, routes, and
controllers
User-friendly display - clear comparison table without repetition
Functional testing - both routes must behave identically
This approach creates a clean duplicate route with an intuitive dashboard
display that demonstrates both URL formats side-by-side.
Townie, stop here! Before proceeding to additional steps, confirm that this
step is working correctly.
If everything is working as intended: conclude this step with these
messages:
Briefly summarize the work that was just completed and why it's important
Provide the URL to the dashboard that you just updated so the user can see
that the new routes are live. Tell the user that they can copy and paste that
URL into a new tab to see the links.
Next step: build a task endpoint that saves /glimpse/:id routes to Notion database pages
Follow the instructions in /_townie/07-save.md to add the /tasks/url
endpoint