tk100/ScriptsApp
2
0
Fork
You've already forked ScriptsApp
0
Web app for displaying the scripts generated from "ScriptsTemplates". https://scripts.phscs.de
  • JavaScript 73.6%
  • CSS 17.8%
  • HTML 8.6%
2026年04月29日 18:54:11 +02:00
app feat: uniform style with bicolored icons 2026年04月29日 18:54:11 +02:00
bin feat: english translation; provide icense for external libs 2026年04月27日 17:12:53 +02:00
.gitignore feat: complete redesign of web app in vanilla js 2025年12月26日 20:54:23 +01:00
.prettierignore feat: complete redesign of web app in vanilla js 2025年12月26日 20:54:23 +01:00
.prettierrc.json feat: complete redesign of web app in vanilla js 2025年12月26日 20:54:23 +01:00
eslint.config.js feat: complete redesign of web app in vanilla js 2025年12月26日 20:54:23 +01:00
index-config.example.json Version 3.0 2026年04月27日 09:04:13 +02:00
LICENSE.md feat: uniform style with bicolored icons 2026年04月29日 18:54:11 +02:00
package.json feat: uniform style with bicolored icons 2026年04月29日 18:54:11 +02:00
README.md feat: uniform style with bicolored icons 2026年04月29日 18:54:11 +02:00

ScriptsApp

This repository consists of two components:

  1. A Node.js script "bin/createIndex.sh" that prepares the scripts (see eepository "ScriptsTemplates" (https://codeberg.org/tk100/ScriptsTemplates)) for publication.
  • Sort all necessary files into the folders app/open, app/ticket, and app/private
  • Create two index files in JSON format: app/open/index.json for public content, app/private/index.json for all content
  1. Web application for publishing scripts (like for example PHySiCS – Materialien
  • HTML pages in the app folder
  • JavaScript files in the app/js folder
  • Assets in the app/icons and app/css folders

The web application is currently only available in German. I would appreciate your support if you would like to enable support for other languages ​​in the code.

Preparation

  1. Clone the repository:
git clone https://codeberg.org/tk100/ScriptsApp.git
  1. Adjust the configuration for generating the index files:
cd ScriptsApp
cp index-config.example.json index-config.json

Edit index-config.json:

  • "srcDir": Path to the main folder where the scripts are located
  • "dstDir": Path to the folder that will later be uploaded to the web server (do not change)
  • "excludeSubjects": List of subjects to exclude, e.g., ["Mathematics"]
  • "allowedTypes": List of allowed types, e.g., ["script", "slides", "index", "link", "exercise", "solution", "h5p", "geogebra"]
  1. Adjust the web application configuration:
cd app
cp app-config-example.js app-config.json

Edit app-config.json:

  • "title": Title of the website
  • "legalUrl": Optional link to the legal notice
  • "privacyUrl": Optional link to the privacy policy
  • "customIcons": Show custom icons (property "icon" in access.json)
  1. Configure web server

IMPORTANT Directory protection (basic authentication) must be set up for the app/private subdirectory on the target web server. This can be done via the provider's interface or a separate .htaccess file.

Update Scripts (build process)

npm run index

Overall Implementation Flow:

  • Each learning area contains an access.json file.
  • Every document (entry in "contents") has the attribute "access".
  • If access="private", the document is sorted into the private folder.
  • If access="ticket", the document is copied into the ticket folder, but with a cryptic directory name (the value of "ticket" in the access.json file). Only those who know the link can access it (this is equivalent to sharing via a link).
  • If access="open, the document is copied, this time with a normal directory name (so that it could be guessed with a little patience...).

Deployment

  1. Local Test

Test the app locally before the actual deployment:

npm run dev

Now open the address "http://localhost:8080" in your browser.

  1. Upload
  • Copy all files from the app folder to your web server.
  1. Test
  • You should only see the public scripts when accessing the index.html file.
  • Does the browser prompt for a password if "Anmelden" is clicked?
  • Are all scripts visible after logging in?