How minhtri593/social_media works
Main Components
• PHP Backend – The heart of the application handling business logic, authentication, content management, user interactions, notifications, and administrative functions. This layer consists of numerous PHP files (e.g., api.php, blogs.php, admin.php, etc.) and controllers invoked via AJAX calls found in the “includes/ajax” directories.
• Smarty Templating Engine – Used to decouple presentation from logic. It’s a core part of the backend, with templates stored in “content/themes/default/templates” and pre-compiled versions in “templates_compiled.”
• Database Layer – Although not explicit in the file tree, a database is implied for storing user data, posts, friendships, messages, settings, and analytics. Represent this as a separate “Database” component.
• Asset and Media Storage – Static content like CSS, JavaScript, images, uploads (photos, videos, sounds) found inside “content/uploads” and “includes/assets.” This component may be hosted on a separate server or a CDN.
• External Services – Include integrations such as Google Authentication, OneSignal push notifications (as seen in OneSignalSDKWorker files), and payment/payment webhook services (as shown in “includes/ajax/payments” and “webhooks” directories).
Relationships and Interactions
• AJAX Communication: Clearly indicate the many AJAX endpoints contained within the “includes/ajax” folder that serve functions such as chat messaging, notifications, and user settings.
• External Integrations: Map how the application communicates with external services (e.g., Google Authentication, push notifications, and payment gateways via webhooks) and how those modules plug into the core system.
Architectural Patterns and Technologies
• Separation of Concerns: Illustrate a clear split between presentation (Smarty templates and Bootstrap for UI), business logic (PHP scripts in root and includes), and data management.
• Real-Time Communication: Highlight components for chat and live notifications where Node.js and AJAX liveliness play key roles.
• Security & Authentication: Note the authentication processes (password recovery, two-factor, login session management) as distinct interaction points between users and the backend.