Frontend Development Workflow
By AkashAman||2 min read
ReactPerformanceOptimizationMCP
Frontend Development Workflow
Development Environment Setup
The project has a live development environment with immediate feedback loop:
-
Run development server:
npm run dev
- Continuously rebuilds both backend (
src/
) and frontend (frontend/src/
) on file changes - Serves project at
http://localhost:8080
- Auto-generates
test/index.html
fromtest/test-traffic.jsonl
via HTML generation
- Continuously rebuilds both backend (
-
Live preview: Browser-sync serves
test/index.html
to Chrome- Automatic browser refresh on frontend changes
- Immediate visual feedback when editing frontend code
-
Screenshot feedback: Use snap-happy tools for visual verification
# List windows to get Chrome window ID mcp__snap-happy__ListWindows # Take screenshot of specific window (Chrome) mcp__snap-happy__TakeScreenshot windowId: <chrome_id>
IMPORTANT: the window id can change! Always list windows before taking a screenshot for a specific app.
Frontend Styling Guidelines
Terminal Aesthetics
- Font size: Always 12px across ALL elements (no typography variations)
- Hierarchy: Use color variations from VS Code theme, not font sizes
- Background colors: Used sparingly for sections/highlighting only
Spacing Rules
-
Vertical spacing: Always em-based multiples (1em, 2em, etc.)
-
Horizontal spacing: Always character-based multiples (monospace)
-
Use Tailwind classes: Never inline styles (
style="..."
) -
Examples:
<!-- Good: Terminal spacing with Tailwind --> <div class="mb-8 p-4"> <span class="mr-12 ml-8"> <!-- Bad: Arbitrary px values or inline styles --> <div style="margin-bottom: 32px; padding: 16px"> <span style="margin-right: 3em;"></span></div ></span> </div>
Color Usage (VS Code Theme)
text-vs-function
: Headers, tool namestext-vs-assistant
: Assistant messagestext-vs-user
: User messagestext-vs-muted
: Secondary info, timestampstext-vs-accent
: Links, hover statesbg-vs-bg-secondary
: Content backgroundsborder-vs-highlight
: Conversation borders
HTML Safety
- All text content automatically escaped via
markdownToHtml()
function - System-reminder tags have special collapsible handling
- No raw HTML injection concerns
Development Flow
- Edit frontend files in
frontend/src/
- Changes trigger automatic rebuild
test/index.html
updates automatically- Browser refreshes to show changes
- Take screenshot to verify improvements
- Iterate quickly with immediate visual feedback
This setup enables rapid frontend development with terminal-style consistency and immediate visual verification.