How rjoserivera/austral_collector works
1. Overall shape
- Austral Collector is a split architecture: a React/Vite single-page frontend in src/ and a PHP REST-style backend in api/.
- The backend persists to MySQL via PDO and stores user-uploaded media under uploads/.
2. Frontend presentation layer
- src/main.jsx, src/App.jsx, and src/pages/ define the routed application shell and page-level views.
- The main pages map to the product areas in the README: home, miembros, perfil público, portafolio, galería, contacto, login, dashboard, and admin.
- src/components/ holds reusable UI blocks such as banners, post modals, featured member cards, voting/ranking sections, videos, footer, and navigation.
3. Frontend data consumption
- The React UI is mostly a consumer of backend JSON endpoints rather than a server-rendered app.
- src/config.js likely centralizes environment/API configuration, while src/hooks/useSyncStatus.jsx and src/utils/offlineSync.js indicate the app tracks connectivity and queues sync work when offline.
4. Public content API
- api/public/ exposes read-only endpoints for the non-authenticated parts of the site:
- home_data.php
- miembros_data.php
- perfil_data.php
- portafolio_data.php
- galeria_data.php
- contacto.php
- identidad.php
- get_hashtags.php
- These endpoints feed the landing page, community listings, profile pages, portfolio/gallery content, and contact/identity data.
5. Authenticated user API
- api/auth/ contains the actions for logged-in community members:
- login.php
- jwt_helper.php
- update_profile.php
- editar_post.php
- publicar_post.php
- reordenar_posts.php
- toggle_like.php
- rate_profile.php
- delete_rating.php
- enviar_clave_temporal.php
- This is the main write path for profile updates, content creation/moderation actions, likes, and ratings.
6. Admin subsystem
- api/admin/ is the privileged back office boundary.
- It includes authentication checks and management endpoints for:
- usuarios.php
- publicaciones.php
- eventos.php
- videos.php
- destacados.php
- galeria_portafolio.php
- identidad_admin.php
- operational reporting via get_stats.php, get_activity_log.php
- admin messaging via enviar_mensaje.php
- src/pages/AdminPage.jsx and DashboardPage.jsx likely consume this layer for moderation and analytics.
7. Backend shared infrastructure
- api/db.php is the shared database connection/bootstrap used by all API groups.
- api/index.php is the likely API entry point or landing endpoint, while api/test_db.php and api/fix_logs.php suggest maintenance/diagnostic utilities.
- api/events.php and api/figures.php sit outside the folder namespaces and likely serve core domain data used across the site.
8. Data and file storage boundaries
- The database holds structured entities such as users, profiles, posts, events, ratings, and activity logs.
- Uploaded or generated media is stored separately in uploads/eventos, uploads/posts, and uploads/profiles, which means the architecture splits metadata in MySQL from binary assets on disk.
- This is important for diagramming because most content flows involve both a database write and an asset upload/write.
9. Authentication and trust model
- Authentication is JWT-based, with login.php issuing tokens and jwt_helper.php enforcing them for protected routes.
- The backend has a clear trust boundary: public endpoints require no token, auth endpoints require a user token, and admin endpoints require elevated verification via auth_check.php.
10. Offline/PWA behavior
- dev-dist/ contains service worker artifacts, and the README mentions vite-plugin-pwa plus IndexedDB.
- The app therefore supports a progressive web app layer with cached assets and local persistence for offline interaction, with offlineSync.js handling reconciliation when connectivity returns.
11. Documentation as a separate artifact
- docs/ is a standalone Mintlify documentation site, not part of runtime application flow.
- It documents architecture, installation, API authentication, figures, and the admin panel, so it should be shown separately from the production data path.
12. Runtime and deployment assumptions
- The stack targets Node.js/Vite for frontend development and PHP 8 + Apache/MySQL for backend execution, typically via XAMPP locally.
- index.html, vite.config.js, eslint.config.js, and package.json define the frontend build/runtime toolchain, while requirements.txt appears ancillary and not central to the main app flow.
13. Primary end-to-end flows
- Public visitor flow: browser loads React app → pages fetch public JSON from api/public/* and core endpoints → content renders without login.
- Member flow: user logs in → JWT is stored/used by frontend → authenticated actions hit api/auth/* → DB and uploads are updated.
- Admin flow: admin authenticates → frontend calls api/admin/* → moderation, reporting, and messaging operations are executed server-side.
Main entry points: App.jsx App shell · admin Admin API · pages Pages · auth Member API
Components 19
Frontend
React/Vite single-page app and client-side offline layer.
- Entry · Bootstraps the SPA and mounts the app.
src/main.jsx - App shell · Top-level application composition and routing.
src/App.jsx - Pages · Route-level pages for home, members, profile, portfolio, gallery, contact, login, dashboard, and admin.
src/pages - UI blocks · Shared interface components such as banners, cards, modals, navigation, and content sections.
src/components - Config · Central frontend configuration for API endpoints and runtime settings.
src/config.js - Offline sync · Tracks connectivity and reconciles queued client work when back online.
src/utils/offlineSync.js - Sync status · Hook exposing connectivity and synchronization state to the UI.
src/hooks/useSyncStatus.jsx - Service worker · Cached runtime asset for offline support and installable behavior.
dev-dist/sw.js - Workbox · Generated service worker runtime used by the offline bundle.
dev-dist/workbox-137dedbd.js
Backend
PHP API surface split into public, member, and admin boundaries.
- Public API · Unauthenticated content endpoints for home, members, profile, portfolio, gallery, contact, and identity data.
api/public - Member API · Authenticated endpoints for login, profile updates, posts, likes, and ratings.
api/auth - Admin API · Back-office endpoints for moderation, reporting, messaging, and administrative content management.
api/admin - DB bootstrap · Shared database connection and backend bootstrap used by API handlers.
api/db.php - Core endpoints · Cross-cutting domain endpoints for figures, events, and API entry/maintenance utilities.
api - JWT helper · Encodes and validates member tokens for protected API routes.
api/auth/jwt_helper.php - Admin check · Verifies elevated access before admin operations run.
api/admin/auth_check.php - API entry · Top-level API entry or landing endpoint.
api/index.php
Docs
Standalone Mintlify documentation site.
- Docs site · Standalone documentation site for architecture, installation, authentication, figures, and the admin panel.
docs
Storage
Database and uploaded media assets.
- Uploads · Filesystem storage for uploaded media and generated assets.
uploads
Connections 23
- Entry → App shell: mounts · Application bootstrap renders the root app shell.
- App shell → Pages: routes · Top-level routing selects page views.
- App shell → UI blocks: composes · Pages are assembled from shared UI components.
- App shell → Config: reads · Frontend uses centralized API/runtime settings.
- App shell → Sync status: tracks · UI consumes sync state to reflect connectivity.
- Sync status → Offline sync: delegates · Hook wraps offline reconciliation logic.
- Pages → Public API: fetches · Public pages load read-only site content.
- Pages → Member API: calls · Member-facing pages invoke authenticated actions.
- Pages → Admin API: calls · Admin and dashboard views consume back-office endpoints.
- Public API → DB bootstrap: queries · Read-only endpoints read structured content from MySQL.
- Member API → JWT helper: validates · Protected member actions authenticate with JWTs.
- Member API → DB bootstrap: writes · Member actions update profiles, posts, likes, and ratings.
- Member API → Uploads: stores media · Post and profile actions may persist uploaded assets.
- Admin API → Admin check: guards · Admin routes enforce privileged access checks.
- Admin API → DB bootstrap: manages · Back-office actions operate on application data.
- Admin API → Uploads: manages media · Admin workflows can manage gallery and portfolio assets.
- Core endpoints → DB bootstrap: uses · Core domain endpoints also depend on the shared database bootstrap.
- Core endpoints → Uploads: reads/writes · Domain endpoints may access stored media assets.
- API entry → Core endpoints: dispatches · Top-level PHP entrypoint routes into API handlers.
- Docs site → Public API: documents · Docs describe the public and authenticated API surface.
- Docs site → Admin API: documents · Docs include the admin panel and operational workflow.
- Service worker → Workbox: runs with · Service worker runtime supports offline caching.
- App shell → Service worker: installs · Frontend registers the service worker for PWA behavior.