How longwater1234/wedemyclient works
The WedemyClient project is a modern, progressive web app (PWA) built as a frontend clone of Udemy. It leverages Vue 3, Vite, and TypeScript and uses a component-based architecture alongside centralized state management (via Pinia). The app is designed to handle online course browsing, enrollment, and checkout with integration to external services like Braintree for payments and Google for OAuth-based login.
Main Components
• Frontend/UI Layer:
• Vue Components (found in src/components and src/views). These include visual parts such as the Navbar, Footer, Cart Summary, Course Details, and the various pages (Home, Login, Signup, Checkout, etc.).
• Routing:
• Vue Router system (located under src/router) that manages how users navigate between views.
• State Management:
• Pinia store (located in src/stores) that maintains application state across multiple components.
• Service Layer:
• Service modules (in src/service) providing API calls and business logic. These include authentication, course management, checkout processing, enrollment, profile handling, etc.
• Assets & Interfaces:
• Assets (images, logos, and styles) and interface definitions (in src/interfaces) that define TypeScript types for ensuring consistency.
• External Integrations:
• Braintree Payments for checkout.
• Google OAuth for sign-in functionality.
• YouTube (for embedded video playback).
• Environment & Configurations:
• Environment variables (.env file based on .env.sample) and build configuration (vite.config.ts) for setting up deployments.
Relationships and Interactions
• The UI components (Views and Components) interact with the centralized state (Pinia) to reflect dynamic data and trigger service calls.
• The Vue Router mediates screen-level navigation; each route is associated with a specific view.
• Service modules are responsible for handling business logic and API interactions. They communicate with backend endpoints (which are provided by a separate Java Springboot application) and external services (Braintree, Google OAuth).
• The interfaces in src/interfaces ensure data consistency between API responses and the application’s internal state.
• Assets, styles, and configuration files bind the look-and-feel of the application, underpinning the user experience.
Architectural Patterns & Design Principles
• Component-Based Architecture: Each Vue component is a distinct, reusable part of the User Interface.
• Centralized State Management: Use of Pinia enables global state sharing and modularized management of application data.
• Separation of Concerns: Splitting the project into services (business logic), components (UI), and state stores (data management) to keep the codebase organized.
• API Abstraction: Service modules abstract away the direct REST calls to the backend and to third-party services (e.g., Braintree, Google OAuth), making integration and future modifications easier.