How cadet-dot-net/liveview-insta-clone works
Main Components
a. Web Layer (Phoenix):
• Router (from lib/finsta_web/router.ex)
• Endpoint (from lib/finsta_web/endpoint.ex)
• Controllers (from lib/finsta_web/controllers)
• Views/Templates (represented by the HTML files)
• Components (from lib/finsta_web/components)
b. Core Application:
• Application Supervisor (from lib/finsta/application.ex)
• Repo (Database Interface) (from lib/finsta/repo.ex)
• Mailer Service (from lib/finsta/mailer.ex)
c. Frontend Assets:
• JavaScript (from assets/js)
• CSS/Tailwind (from assets/css)
d. Database Layer:
• A database symbol representing the PostgreSQL database
• Migrations directory connection (priv/repo/migrations)
Component Relationships
• Client Browser → Phoenix Endpoint
• Endpoint → Router
• Router → Controllers
• Controllers → Views/Templates
• Controllers → Repo
• Repo → Database
• Templates → Components
• Assets → Client Browser
Additional Elements
Supporting components:
• Telemetry system (lib/finsta_web/telemetry.ex)
• Gettext for internationalization
• Configuration layers (config directory)
Architectural Patterns to Highlight
• Model-View-Controller (MVC) pattern
• Phoenix's Context pattern (though not heavily implemented yet)
• Supervision tree structure
• Request/Response lifecycle
Important Notes
Annotations for:
• Phoenix LiveView capabilities (if implemented)
• Telemetry monitoring points
• Database migration workflow
• Asset compilation pipeline
• Development vs Production configurations
Remember to emphasize:
• The separation between web and core application layers
• The role of the Router and Endpoint as entry points
• The relationship between Controllers, Views, and Templates
• The database interaction layer through the Repo
• The asset compilation and delivery pipeline
This structure will give other developers a clear understanding of how the application's components interact while maintaining Phoenix's conventional architecture.