Petri WebGen


PHP 7
JavaScript

Creation of a conversion engine to transform multimedia scenarios modeled with Petri nets into a web application.

Thesis Advisor: Professor Eytan Zysman

In user mode (not debug), the application starts by requesting the petri net in JSON format as generated by the Petri net designer application. The Petri net designer application is another app that generates the JSON file representing the visual design of the Petri net.

If the provided file is not a JSON file or is larger than 10 MB (which should be more than enough even for a file describing a large website), it will not be accepted and an error message will be displayed. On the other hand, if the provided file meets these requirements, the interface proceeds to the next step by requesting the STAMP file containing the digital fingerprint and the hashed password to convert this Petri net into a web application.

If the interface is set to require a password when converting the JSON files, a window will appear for the user to enter their password. If the password is incorrect, the user is notified, otherwise the window disappears and the generation process begins. If a password is not required in the configuration, this step is skipped and the web application is generated directly.

Once the generation is finished, the user can view the result of his Petri net described website live. They can start their site from the index page, if it has been specified, or go through its scenes/views one by one to check that everything is as they described in their Petri net. Of course, the local multimedia files you may have included are not displayed here. The user can choose to export his web application in a zip format, or to convert another Petri net, which will bring him back to the very first window described above.

If the user modifies the JSON file generated by the schema application, the interface detects this and informs the user that the file is not the original generated file. Only an experienced user who knows exactly how to generate the digital fingerprint of their file can avoid this message by generating the fingerprint of their modified file themselves. Since the fingerprint is the sha512 hash of the file, hashed in HMAC style using the hashed password as the secret key, a user who is able to change the fingerprint can easily change the password.

The original file was manually modified by the user

If any errors occur while processing the JSON file processing, they will be displayed to the user as shown in the screenshot below: