Skip to content

Conversation

@erseco
Copy link

@erseco erseco commented Jan 10, 2026

This pull request introduces a new unified data access layer to support a static/offline mode for the eXeLearning app, allowing it to run without a backend server. It adds the DataProvider abstraction, updates the app initialization and runtime logic to detect and operate in static mode, and adapts build and deployment workflows for static site generation and PR previews. The changes also include updates to tests and deployment scripts to ensure compatibility with the new static mode.

Core application changes:

  • Introduced a new DataProvider class (public/app/core/DataProvider.js) that abstracts data access, switching between server API calls and pre-bundled static data depending on the detected mode. This enables the app to function both online and offline.
  • Updated App class (public/app/app.js) to initialize and use DataProvider, detect static/offline mode via multiple signals (explicit flag, file protocol, or missing server URL), and adjust flows such as checks and modals accordingly. [1] [2] [3] [4] [5] [6]
  • Modified MathJax loader logic to retain relative paths in static mode, ensuring proper loading of math rendering assets when offline. (public/app/common/common.js)

Build and deployment workflow updates:

  • Added a new build script build:static to generate a static bundle for offline use (package.json).
  • Introduced a new GitHub Actions workflow (.github/workflows/pr-preview.yml) to build and deploy PR previews as static sites, leveraging the static build output.
  • Updated the main deployment workflow (.github/workflows/docs-and-repos.yml) to use a unified deploy action and adjusted permissions for static site deployment. [1] [2]

Testing and configuration:

  • Adjusted tests in public/app/app.test.js to mock static mode detection and ensure normal flows are tested for both modes. [1] [2] [3] [4]

These changes lay the foundation for fully supporting offline/static usage of the app, improving flexibility for users who need to run eXeLearning without a backend server.

@vercel
Copy link

vercel bot commented Jan 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
exelearning Error Error Jan 10, 2026 11:15am

@github-actions
Copy link

github-actions bot commented Jan 10, 2026

PR Preview Action v1.8.0

QR code for preview link

🚀 View preview at
https://ateeducacion.github.io/exelearning/pr-preview/pr-17/

Built to branch gh-pages at 2026-01-10 20:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98bd9246ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +236 to +238
// Priority 3: No server URL configured
if (!this.eXeLearning.config.fullURL) {
return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat root installs as server mode

The static-mode heuristic treats an empty config.fullURL as “no server configured”, but the server sets fullURL to basePath, which is an empty string for root installs (BASE_PATH unset). In that common deployment, this branch forces static mode even though a server is available, so API routes won’t load and the app will fall back to empty static data. That breaks normal server behavior for root installs; consider basing this on an explicit static flag/file protocol or a separate server indicator rather than fullURL being non-empty.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants