How annerh3/fernandarentals-frontend works
Project type and purpose
• This is a single-page front-end application (“Fernanda Rentals”) built with React, Vite, Tailwind CSS and JavaScript.
• It provides a public website for browsing/renting event products, a PayPal-based payment flow, and an administration dashboard to manage categories, products, events and users.
File structure
• Top-level “FernandaRentals-Frontend” contains:
• public, index.html, package.json, Vite/Tailwind configs
• src/App.jsx and main entry src/main.jsx
• src/features split by domain: Website, administration, security
• src/shared for cross-cutting actions, components, utils
• src/config/api for WebApi and PayPal API client code
• There are custom hooks, forms, pages, routes, and store modules under each feature – indicating a feature-based modular architecture.
• Shared/actions suggests a Redux-style action layer; store files under features indicate per-feature Zustand or Redux Toolkit slices.
README
• The README only states the project’s name (“Fernanda Rentals | UNAH COPAN”) and doesn’t include an architectural overview or dependencies. All architecture details come from the file tree.
Main components
a. User / Browser:
• End user interacts via modern browser.
b. Front-End SPA:
• UI Layer – pages and components (Website pages, Administration pages, Security pages)
• Routing Layer – AppRouter, WebRouter, AdministrationRouter, SecurityRouter
• State Management – shared actions + per-feature store/hooks
• API Client Layer – WebApi.jsx for backend calls; PaypalSandBoxApi.js & paypayCheckout/refundPayment modules
c. External Services:
• Backend REST API (not in this repo) for authentication, categories, products, events, clients, finances, notes
• PayPal Sandbox for payment processing
d. Build & Deployment:
• Vite build, PostCSS/Tailwind CSS pipeline, static hosting
Relationships & Interactions
• User → Browser → React SPA
• Routing layer resolves URL → renders component/page
• Component dispatches actions or invokes store hooks → updates store → UI re-renders
• UI or store invokes API Client → HTTP request to REST API → response flows back → store update
• For payments: component or hook calls PayPal client → redirect to PayPal → callback returns status → refund/payment modules handle interactions
• Shared utils and constants support formatting, validation, roles
Architectural patterns & design principles
• Feature-based modularization (separate folders for Website, Administration, Security)
• Component hierarchy: shared vs feature-specific
• Unidirectional data flow: actions → store → components
• API abstraction layer: isolate HTTP details in config/api modules
• Custom hooks to encapsulate data fetching and local state
1. Top: “User/Browser”
2. Next: “React SPA” subdivided into:
• Routing
• Pages & Components (group by Website, Administration, Security)
• State Management (shared actions + feature stores/hooks)
• API Client (Web API & PayPal)
3. Bottom: “External Services” with two nodes:
• Backend REST API
• PayPal Sandbox
• Browser → SPA
• SPA Routing → Components → Store → API Client → External Services
• External Services → API Client → Store → Components
• Blue rectangles for UI layers
• Green for state management
• Orange for API clients
• Labels:
• Name each component (e.g., “Website Page: HomePage.jsx”) or group them (e.g., “Website Pages”)