How vikasraog6/online-tutorial-web-app-frontend works
Project Type and Purpose
• This is a single-page application (SPA) built with React and bundled by Vite.
• It provides an educational dashboard (pages like Courses, Quizzes, ManageCourses, etc.) and includes an AuthContext for user authentication.
• It is deployed as a static web app (Azure Static Web Apps) via GitHub Actions.
File Structure
• src/: Contains React components (App.jsx, pages/), context/AuthContext.jsx for state management, and utils/api.js for REST calls.
• public/index.html & src/index.html: HTML templates.
• Vite config & ESLint config: vite.config.js, eslint.config.js drive the build/tooling.
• .github/workflows/: Three Azure Static Web Apps CI/CD pipelines.
Core Components
a. Developer Environment
• IDE / Local machine
• Node.js / npm (or yarn)
• Vite Dev Server (HMR)
b. Source Code & CI/CD
• GitHub repository
• GitHub Actions workflows (azure-static-web-apps-*.yml)
• Build step (vite build)
• Deploy step (Azure Static Web Apps)
c. Hosting & Runtime
• Azure Static Web Apps (serves built JS/CSS/HTML)
• CDN layer (optional, if used by Azure)
d. Client & Browser
• React SPA running in user’s browser
• React Context for auth, React Router for page navigation
e. API Layer & External Services
• utils/api.js → calls external REST API endpoints (e.g., your backend service)
• Authentication provider (could be Firebase/Auth0/custom backend)
• Backend service(s) & database (PostgreSQL, MongoDB, etc.)
Relationships & Data Flows
• Developer → (push) → GitHub
• GitHub Actions → (build) → Vite bundles static assets → (deploy) → Azure Static Web Apps
• Browser → (GET) → Azure Static Web Apps → serves index.html + JS/CSS
• React SPA → (XHR/Fetch via utils/api.js) → Backend API → Database
• React Context/AuthContext → manages login/logout, token storage → Auth provider
Architectural Patterns & Technologies
• SPA pattern: all routing & UI rendering client-side
• Context API for global state (authentication)
• Module-based file structure: components in pages/, assets in assets/, utilities in utils/
• Vite for fast development (HMR) and optimized production builds
• ESLint for code quality
• GitOps-style CI/CD via GitHub Actions and Azure Static Web Apps
Must-Include Elements
• Build step: vite build
• Deployment: Azure Static Web Apps
• Client: Browser running React SPA
• Internal SPA sub-components: AuthContext, Pages, API Utils
• External: API Server → Database, Auth Provider