diff --git a/Wwws_project.md b/Wwws_project.md index 7d73b62..1a69f87 100644 --- a/Wwws_project.md +++ b/Wwws_project.md @@ -5,8 +5,50 @@ apXtri comes with a tailwindcss / daisyUi settings to allow developer to sales w ## How it works ? -An app project is an item of object wwws, a web component (wco) is an item of object wco.
-To make an app project on line http://appname.tribename.townname.nationname/pagename_lg.html, nginx conf must be set in tribename/nginx/appname.tribename.townname.nationname.conf
+- An app project : an item of object wwws +- A web component (wco) : an item of object wco. + +### wwws - appname + +- wwws/{appname}/src source file of the app +- wwws/{appname}/src/{pagename}_{lg}.html the webpage in specific language lg +- wwws/{appname}/src/static/css/input.css contain the tailwind and daisyUI personnalisation (https://daisyui.com/theme-generator) +- wwws/{appname}/src/tpldata/{pagename}/{wcoid}_{wconame}_{lg}.json data personalisation of a component wconame for an HTML element with id=wcoid +- wwws/{appname}/dist build from the source (src forlder) +- wwws/itm/{appname}.json context of the app that contain all data needed to personnalize the wco + +To make an app project in line http://appname.tribename.townname.nationname/pagename_lg.html : + + - nginx conf must be set in tribename/nginx/appname.tribename.townname.nationname.conf + -  for dev /etc/hosts must contain 127.0.0.1 appname.tribename.townname.nationname + - for prod a DNS must redirect to the apxtri server + +### wco - web component + +- wco/{wconame}/{wconame}.js the engine that make wco is render depending of template +- wco/{wconame}/{tplname}[_{lg}].mustache a mustache template can be language dependant or independant (data are in json) +- wco/{wconame}/example{tplname}_{lg}.json a data example to customize the wco + + +### wwws and wco + +In /adminapi/package.json 2 scripts: + +``` +{ + "src:css": "npx @tailwindcss/cli -i ../$tribe/objects/wwws/$webapp/src/static/css/input.css -o ../$tribe/objects/wwws/$webapp/src/static/css/output.css --watch", + "dist:css": "node apxtri/models/Wwws.js $tribe $webapp dist && tailwindcss --minify -i ../$tribe/objects/wwws/$webapp/src/static/css/input.css -o ../$tribe/objects/wwws/$webapp/dist/static/css/output.css" +} +# To dev : it produces wwws/{appname}/src/static/css/output.css on the flight when something change in an html, js, mustache as well in a wco called in an html. +$ tribe=adminapi webapp=admin yarn src:css + +# To build : it minifies output.css in dist and merge, minify, uglify all js used and optimize image, manage language (THIS IS UNDER CONSTRUCTION) +$ tribe=adminapi webapp=admin yarn dist:jscss + +``` + + + Then the webapp can get context data with the endpoint http://appname.tribename.townname.nationname/api/adminapi/wwws/updatelocaldbanonymous/tribename/appname/pagename/versionnumber this will return in data a set of data parameter into tribename/objects/wwws/itm/appname.json