Architecture
Welcome to the MyStoryFlow architecture documentation. This section covers the technical architecture, system design, and infrastructure decisions.
Overview
MyStoryFlow is built as a modern monorepo application using Next.js, with multiple apps serving different purposes while sharing common packages and infrastructure.
Key Sections
System Architecture
- Overview - High-level system architecture
- Monorepo Structure - How our monorepo is organized
- Authentication System - Auth architecture and flows
- Session Management - Cross-app session handling
- Cross-App Authentication - SSO implementation
- Admin Dashboard - Admin system architecture
- User Impersonation - Support features
v1.1 Architecture
The v1.1 architecture represents a significant evolution in our approach, implementing the Story = Chapter model and simplifying the user experience.
- v1.1 Overview - Introduction to v1.1 architecture
- Quick Reference - One-page decision guide for developers
- v1.1 UX Roadmap - Full implementation plan and phases
- Database Schema v1.1 - Complete database design
- Implementation Gap Analysis - Current vs target state
- Competitor Analysis - Industry research and positioning
User Experience & Onboarding
- Book Creation Wizard & Onboarding - Complete wizard flow with PrintOrderStep and post-payment onboarding
- Unified Story Canvas - Story editor as primary canvas with voice/AI side panels (Phase 0)
Start here if you’re new: Read the Quick Reference for a one-page summary of key architectural decisions, then dive into the v1.1 UX Roadmap for the full implementation plan.
Architecture Principles
- Modularity - Separate apps for different concerns
- Reusability - Shared packages for common functionality
- Scalability - Designed to grow with user needs
- Security - Privacy-first architecture
- Performance - Optimized for speed and efficiency
- Simplicity (v1.1) - Story = Chapter model reduces complexity
Implementation Status
Some features documented here are planned for future releases:
| Feature | Status |
|---|---|
| Cross-App Authentication | ✅ Implemented |
| Session Management | ✅ Implemented |
| User Impersonation | ✅ Implemented |
| Feature Flags | ✅ Implemented |
| Role-Based Access (user/support/admin) | ✅ Implemented |
| Audit Logging | ✅ Implemented |
| Multi-Factor Authentication (MFA) | 🔜 Planned |
| BroadcastChannel Cross-Tab Sync | 🔜 Planned |
| Session Encryption | 🔜 Planned |
| Biometric Authentication | 🔜 Planned |
| Advanced Threat Detection | 🔜 Planned |