How vamshikittu22/wanderlusttrails works
Project’s Main Components
• Frontend: Located under the “Frontend/WanderlustTrails” directory (and a separate “test” folder with similar structure), this contains the user interface, pages (such as Home, Login, Signup, BookingDetails, etc.), reusable React components (for header, footer, dashboards, etc.), context management (e.g., TodoContext and UserContext), assets (images, videos), and routing.
• Backend: Found in the “Backend” folder, this includes PHP scripts providing APIs for various functionalities: authentication (login, signup, logout, JWT helper, etc.), managing travel packages, user operations, booking operations (create, edit, cancel, view bookings), and even a todo management system. There is a separation ensuring different API endpoints and controllers organized under subdirectories like “config/AdminDashboard”, “config/UserDashboard”, “config/booking”, etc.
• Database: Although no explicit DB server is defined, the existence of “Backend/db” (with inc_dbconfig.php) implies a relational database for persisting user data, booking information, travel packages, etc.
• Assets: Shared static resources (images, video) exist both in the root “Assets” and inside the Frontend directory, which should be shown as data/resource stores.
• External Dependencies: The backend uses PHP Composer (composer.json and composer.lock) while the frontend has package.json dependencies (React, Vite, Tailwind, and ESLint configurations). Note also potential JWT authentication libraries and others used in the PHP and JS stacks.
Out the Relationships and Interactions
• Client (Browser) interacts with the Frontend application (React SPA). The pages and components make API calls to the backend.
• The Frontend’s API service (apiService.js) is the bridge to the PHP API endpoints in the Backend.
• The Backend scripts handle authentication, user management, booking processing, and admin functionalities. These scripts interact with the Database (detailed in inc_dbconfig.php) to perform CRUD operations.
• The separation between Admin and User dashboards should be captured, with distinct API calls and UI components for each type of user.
• Static Assets (images, videos, etc.) are used by frontend components to enrich the UI, and some may also be managed/uploaded from the backend.
Important Architectural Patterns and Technologies
• Client-Server Architecture: Clear distinction between frontend (React SPA) and backend (PHP API).
• MVC-like Pattern: Even if not a textbook MVC, the backend has separate configurations for various operations (authentication, booking, user management) and corresponding model files (for database and business logic).
• RESTful API Design: PHP files like getAllBookings.php, createBooking.php, etc. act as endpoints for various actions.
• Use of JWT for Authentication: Indicated by “jwt_helper.php” in the auth folder, suggesting token-based user session management.
• Modularization: Separation of concerns for the admin dashboard vs. user dashboard and for different features (booking, travel packages, todos).