mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
🛡️ Open-source and next-generation Web Application Firewall (WAF)
| .vscode | ||
| jsdoc | ||
| vue2md | ||
| vuejs | ||
| wtforms | ||
| package-lock.json | ||
| README.md | ||
Vuejs
Principle
We can develop the front-end using Vue and Vite framework.
I have all my front-end logic inside client folder.
We can use all the facilities of the framework, for this example you have :
componentfolder : create a component to use in your pagepagesfolder : contains each pages to render, we have only one page test ATM
Inside pages folder, you have 3 files :
index.htmlthat is entry point, we define entry point for Vue app and a div with attribut data-flask to store futur data from templatetest.jsis js entry point that define the Vue components, plugins and settings to use for this pageTest.vueis the page (global context) where we are importing components, executing logic... For example, we are retrieving data-flask from here
We have others files for the configuration of node modules and Vite.
We need to work on the front-end here, then build and move to flask app the resources when needed.
Installation
- Need to install
node.jsandnpmon computer - Go inside
vuejsfolder and runnode build.js - Run
flask --app main.py runthen access/testto get Vue.js rendering app using flask dataTitle from Flask ! /test2is case with no flask data (can be handle on a div or directly on Vue app)
jsdoc (render doc from .vue components)
We can create a markdown documentation for components.
npm install -g documentationwill add lib that format js to doc- set input and output folder in
vue2md.js - once done, run
node vue2md.js, this will format .vue to .js, run subprocess to render .js to .md for each file, and finally script will merge in order and by path all .md files