Skip to content

Frontend Architecture

Re-Krass edited this page Nov 16, 2026 · 1 revision

πŸ–₯️ Frontend Architecture

The frontend source lives in ydl-front and uses the original Vue 2 / Webpack 3 stack. It is used both with Django locally and with a browser mock adapter in the public Pages demo.

Important source tree

πŸ“¦ ydl-front/
┣ πŸ“‚ build/                   # Webpack build pipeline
┣ πŸ“‚ config/                  # Development and production asset paths
┣ πŸ“‚ src/
┃ ┣ πŸ“„ App.vue                # App shell and session initialization
┃ ┣ πŸ“„ main.js                # Vue bootstrap
┃ ┣ πŸ“‚ router/
┃ ┃ β”— πŸ“„ index.js             # Hash-based routes
┃ ┣ πŸ“‚ store/
┃ ┃ ┣ πŸ“„ api.js               # Axios client and demo adapter switch
┃ ┃ β”— πŸ“„ store.js             # Vuex data/actions
┃ ┣ πŸ“‚ demo/
┃ ┃ ┣ πŸ“„ data.js              # Fictional sample data
┃ ┃ ┣ πŸ“„ mockApi.js           # Simulated REST endpoints
┃ ┃ ┣ πŸ“„ session.js           # Demo role/session behavior
┃ ┃ ┣ πŸ“„ announcements.js
┃ ┃ β”— πŸ“„ resources.js
┃ β”— πŸ“‚ components/
┃   ┣ πŸ“‚ Authorization/      # Login and signup views
┃   ┣ πŸ“‚ Course/             # Browse, create, edit, enroll
┃   ┣ πŸ“‚ Forum/              # Discussion and replies
┃   ┣ πŸ“‚ Quiz/               # Questions, answer components, quiz editing
┃   ┣ πŸ“‚ Calendar/           # Monthly calendar and timetable
┃   ┣ πŸ“‚ Profile/            # Dashboard and user settings
┃   ┣ πŸ“‚ Resources/          # Course resource list and upload form
┃   ┣ πŸ“‚ LandingPage/        # Branding and announcements
┃   ┣ πŸ“‚ Demo/               # Demo toolbar and teacher quiz editor
┃   β”— πŸ“‚ Navigation/         # Navbar and sidebar
┣ πŸ“‚ static/demo-resources/   # Downloadable fictional learning files
β”— πŸ“‚ docs/                    # Generated static build output

Only the important directories are shown. Older experimental prototypes and test scaffolding also exist in the historical repository.

Component and data flow

flowchart TD
  Router["Vue Router (hash mode)"] --> Shell["App.vue / ProfilePage.vue"]
  Shell --> Course["Course components"]
  Shell --> Forum["Forum components"]
  Shell --> Quiz["Quiz components"]
  Shell --> Calendar["Calendar / events"]
  Course --> Vuex["Vuex store"]
  Forum --> Vuex
  Calendar --> Vuex
  Vuex --> Axios["src/store/api.js β€” Axios"]
  Axios -->|"Local full-stack"| DRF["/api/ β†’ Django"]
  Axios -->|"Pages build"| Mock["src/demo/mockApi.js"]
Loading

The components primarily interact with existing store actions and Axios APIs; the public demo swaps the transport behavior rather than rebuilding all screens.

Student and teacher routes

Examples from the restored Vue hash router:

View Example fragment
Landing page /#/
Student dashboard /#/profile/2/courses/
Course catalog /#/profile/2/allcourses
German Conversation A2 /#/profile/2/courses/1
Quiz /#/profile/2/courses/1/quiz
Forum /#/profile/2/courses/forum
Calendar /#/profile/2/calendar/
Teacher course editor /#/profile/1/courses/1/edit
Teacher quiz editor /#/profile/1/courses/1/quiz/edit

User IDs here are fictional demo identities, not universal URL contracts. GitHub Pages is particularly suited to hash routing, because fragment routes do not require server-side rewrite rules.

Rendering and editing

  • Course descriptions may contain rich text; rendering and editing need consistent treatment of paragraphs and line breaks.
  • Interactive quizzes provide immediate local feedback in the demo; no Django attempt history is published.
  • Vue components are subject to the project's historical ESLint/Standard rules (for example no semicolons and no trailing commas).
  • The Pages-specific Webpack build uses YDL_BUILD_TARGET=pages and an asset base path /.

German Conversation A2 student course view

Next: Public demo mode Β· Feature showcase

Clone this wiki locally