133: Sam Selikoff - Building Production-Ready SPAs Fast with Mirage.js
Episode
63 min
Read time
2 min
Topics
Productivity, Relationships, Startups
AI-Generated Summary
Key Takeaways
- ✓Development workflow integration: Mirage runs in the same process as your front-end application without requiring separate terminal tabs or port configurations. Import the library into your bootstrap file, instantiate the server in development mode, and define endpoints that intercept fetch requests while maintaining identical application code for production.
- ✓In-memory database layer: Mirage maintains referential integrity across route handlers through a shared JavaScript object database. Create data using factory patterns inspired by Rails' factory_bot, define relationships like director-has-many-movies, and mutations persist across navigation without managing foreign keys manually, enabling realistic multi-page workflows during development.
- ✓Testing and development code reuse: The same route handler definitions work in both development and testing environments. Tests start with an empty database and use server.create to set up specific scenarios, while development uses seed hooks. This eliminates duplicate mocking code and keeps tests focused on assertions rather than API implementation details.
- ✓Serializer layer flexibility: Mirage separates database conventions from API response formats through a serializer layer. Store data using camelCase JavaScript conventions internally, then configure serializers for JSON API, Active Model Serializer, or custom formats. Built-in serializers handle root keys, meta information, and relationship linking without changing database structure.
- ✓State management advantages: Front-end developers can define multiple data scenarios locally without coordinating shared staging environments or running complex back-end infrastructure. Switch between states like anonymous user, subscriber, or admin by changing variables in seed files. Hot module reloading applies data changes instantly without restarting servers or running database migrations.
What It Covers
Sam Selikoff explains Mirage.js, an API mocking tool that intercepts HTTP requests in JavaScript applications, enabling front-end developers to build production-ready features without waiting for back-end APIs by creating an in-memory database alongside their development workflow.
Key Questions Answered
- •Development workflow integration: Mirage runs in the same process as your front-end application without requiring separate terminal tabs or port configurations. Import the library into your bootstrap file, instantiate the server in development mode, and define endpoints that intercept fetch requests while maintaining identical application code for production.
- •In-memory database layer: Mirage maintains referential integrity across route handlers through a shared JavaScript object database. Create data using factory patterns inspired by Rails' factory_bot, define relationships like director-has-many-movies, and mutations persist across navigation without managing foreign keys manually, enabling realistic multi-page workflows during development.
- •Testing and development code reuse: The same route handler definitions work in both development and testing environments. Tests start with an empty database and use server.create to set up specific scenarios, while development uses seed hooks. This eliminates duplicate mocking code and keeps tests focused on assertions rather than API implementation details.
- •Serializer layer flexibility: Mirage separates database conventions from API response formats through a serializer layer. Store data using camelCase JavaScript conventions internally, then configure serializers for JSON API, Active Model Serializer, or custom formats. Built-in serializers handle root keys, meta information, and relationship linking without changing database structure.
- •State management advantages: Front-end developers can define multiple data scenarios locally without coordinating shared staging environments or running complex back-end infrastructure. Switch between states like anonymous user, subscriber, or admin by changing variables in seed files. Hot module reloading applies data changes instantly without restarting servers or running database migrations.
Notable Moment
Selikoff reveals that some development teams have successfully deployed Mirage-powered prototypes to production using local storage for persistence, creating fully functional demos for sales teams. Future plans include generating real Node.js back-end servers directly from Mirage definitions, potentially eliminating the need to manually build APIs for data-driven applications.
You just read a 3-minute summary of a 60-minute episode.
Get Full Stack Radio summarized like this every Monday — plus up to 2 more podcasts, free.
Pick Your Podcasts — FreeKeep Reading
More from Full Stack Radio
153: DHH – Omarchy and Designing Your Own OS on Arch Linux
Aug 21 · 76 min
10% Happier with Dan Harris
How To Regulate Your Nervous System: Anxiety, Relationships, and the Baggage You Didn't Ask For | Dr. Bruce Perry
Jul 1
More from Full Stack Radio
152: Ben Orenstein - How to Stand Out When Applying for a Job at a Small Company
Jan 28 · 47 min
This Week in Startups
The hottest running app has nothing to do with speed | E2303
Jun 22
Books, tools, and gear mentioned in this episode
SignalCast may earn commission on purchases via these links.
Tools
“Create data using factory patterns inspired by Rails' factory_bot, define relationships like director-has-many-movies, and mutations persist across navigation.”
“Sam Selikoff explains Mirage.js, an API mocking tool that intercepts HTTP requests in JavaScript applications, enabling front-end developers to build production-ready features without waiting for back-end APIs.”
More from Full Stack Radio
We summarize every new episode. Want them in your inbox?
153: DHH – Omarchy and Designing Your Own OS on Arch Linux
152: Ben Orenstein - How to Stand Out When Applying for a Job at a Small Company
151: DHH – Building HEY with Hotwire
150: Secret Screencasting Tips & Behind the Scenes of Tailwind CSS 2.0
149: Choosing a Payment Processor, Radical Icons & W3C Hype
Similar Episodes
Related episodes from other podcasts
10% Happier with Dan Harris
Jul 1
How To Regulate Your Nervous System: Anxiety, Relationships, and the Baggage You Didn't Ask For | Dr. Bruce Perry
This Week in Startups
Jun 22
The hottest running app has nothing to do with speed | E2303
How I AI
Jun 22
How Claude Mythos found a 15-year-old bug in Mozilla Firefox | Brian Grinstead
10% Happier with Dan Harris
Jun 15
What Attachment Style Are You? How To Know, Why It Matters, and How To Change It If You Need To | Amir Levine
Eye on AI
Jun 6
Every Enterprise Is About to Have a 100,000 Agent Problem | Oren Michaels of Barndoor AI
Explore Related Topics
This podcast is featured in Best Cybersecurity Podcasts (2026) — ranked and reviewed with AI summaries.
Read this week's Startups & Product Podcast Insights — cross-podcast analysis updated weekly.
You're clearly into Full Stack Radio.
Every Monday, we deliver AI summaries of the latest episodes from Full Stack Radio and 192+ other podcasts. Free for one show.
Start My Monday DigestNo credit card · Unsubscribe anytime