How rpuls/medusajs-2.0-for-railway-boilerplate works
High-Level Architecture Components
The system consists of two main applications:
• Backend (Medusa.js)
• Storefront (Next.js 14)
Plus several essential services:
• PostgreSQL Database
• Redis Cache
• MinIO Object Storage
• MeiliSearch
• Resend Email Service
• Stripe Payment Service
Key Relationships to Highlight
• Client requests flow through Next.js server components to the backend API
• Authentication and session management between frontend and backend
• Product search flows through MeiliSearch
• File upload/download paths through MinIO
• Email notification flows through Resend
• Payment processing through Stripe
• Caching mechanisms with Redis
• Database operations with PostgreSQL
Component Details
Backend:
/backend
• src/
• api/ (REST endpoints)
• modules/ (Custom functionality)
• subscribers/ (Event handlers)
• services/ (Business logic)
Storefront:
/storefront
• src/
• app/ (Next.js 14 routes)
• modules/ (Feature modules)
• lib/ (Shared utilities)
Additional Notes
• Version numbers (Medusa 2.1.3)
• Development vs production paths
• Fallback mechanisms
• Monitoring points
Remember to include both synchronous (API calls) and asynchronous (event-driven) interactions in the system, as Medusa uses both patterns extensively.