Tutorial: 01_Getting_Started

01_Getting_Started

Required tools

  • yarn >= 1.22
  • Node.js >= 14
  • PHP >= 7.1
  • MYSQL >= 5
  • Composer >= 2.3

Setup local installation

  • After checking out this project, do as follows:
bash
git submodule init
git submodule update
composer install
cd public/javascript
yarn install
yarn init-frontend
  • the root folder for your local webserver is public

Working local

Google Closure works with a dependency list (public/javascript/deps.js) in local development mode to resolve the paths to the imports. So if new javascript classes are created or new javascript imports are added to existing classes it is advisable to rebuild the list using the yarn js-deps command.

To build the styles (public/css/style.css) the command yarn css-compile can be used. With yarn init-frontend a watcher is already started which monitors changes in the scss files and then regenerates the css. If the command yarn init-frontend --bs is used, BrowserSync (https://browsersync.io/) is additionally activated which makes a page reload to display changes in the styling no longer necessary.

Building for production

bash
cd public/javascript
yarn css-compile
yarn js-compile
yarn install --production

Notice! Google Colsure uses an extended compilation which makes it necessary to define external frameworks via externs more precisely. The externs are specified in the gulp file (public/javascript/gulpfile.js) during the compilation process. Also anonymous objects can be compressed too much if they are not exactly defined by the annotation or the keys are not formatted as string, which can lead to their properties not being callable / assignable elsewhere in the compiled js file (public/javascript/app.min.js). Find more infos under: https://developers.google.com/closure/compiler/docs/api-tutorial3

Backend access

The backend is located in folder public/admin. You can access is in the browser via /admin. Please adapt the public/admin/.htpasswd to your own credentials. In app/database there is a mysql dump of the database structure. Database access data for the backend communication are managed in public/admin/db.php.

Creating the documentation

The documentation is generated automatically with JSDocs https://jsdoc.app/ using the command yarn generate-docs in the public/javascript/ folder. The JSDocs configuration can be found here in public/javascript/jsdoc-conf.json. The generated documentation can then be found in the folder public/docs.