====== Picalook ====== {{/dokuwiki/lib/images/smileys/fixme.gif|FIXME}} ===== Backend ===== The Git projects for the Picalook backend is located in four places * [[https://git.picalike.corpex-kunden.de/incubator/picalook-middleware|Picalook Middleware]] for the scripts and direct widget endpoint * The [[https://git.picalike.corpex-kunden.de/v3/v3-frontend-deploy|Frontend Deploy]] for the picalook.php endpoint, that receives the lookid and shop to return products, and lilly query to return color data and features data * The [[https://git.picalike.corpex-kunden.de/picalike/pci|PCI project]], that has picalook endpoint to create, delete, deal with picalook reference looks * The [[https://git.picalike.corpex-kunden.de/v3/v3-lilly-export|v3-lilly-export]] due to special lilly collections, the 8000XXXX (The four X is the normal shop uid) and the 80007510, this is important for the frontend-deploy The backend uses MongoDB, Python, FastAPI, Gunicorn, Pymongo (Version 3.13 due to [[https://www.mongodb.com/docs/drivers/pymongo/#compatibility|max compatibility]] with the mongo versions) It's connects to four databases * meta_db database (to grab the translated categories, attributes) * mapping_service (to grab the translated color data) * visualytics setting database (to grab the user, widget_settings and widget_hash collections) * visualytics data database (to grab the styles data and the customer data) The backend steps is:
    * Run the [[https://git.picalike.corpex-kunden.de/incubator/picalook-middleware/-/blob/main/scripts/reference_shop_to_csv.py|reference_shop_to_csv.py]] to generate the CSV file to be imported * Add the picalook: true for the customer shop config in the user collection (use uid 4149, madeleine_de_feed as example) * Run the [[https://git.picalike.corpex-kunden.de/incubator/picalook-middleware/-/blob/main/scripts/customer_shop_to_visualytics.py|customer_shop_to_visualytics.py]] to add the picalook data to the normal ic_XXXX collection (look at ic_4149 as example) * Run the [[https://git.picalike.corpex-kunden.de/incubator/picalook-middleware/-/blob/main/scripts/convert_looks_ref_to_customer.py|convert_looks_ref_to_customer.py]] to convert the reference looks from 8000 to the designated shop (Set the uid to 4149 as example) * After this, the scripts from v3-lilly-export ([[https://git.picalike.corpex-kunden.de/v3/v3-lilly-export/-/blob/master/bin/lilly_data_from_mongo|lilly_data_from_mongo]] and [[https://git.picalike.corpex-kunden.de/v3/v3-lilly-export/-/blob/master/bin/export_looks|export_looks]] need to be run [lilly_data_from_mongo need to run for the selected customer shop, ex: 4149]) * After all the frontend import the 8000, 8000XXXX and 80007510, the customer functionality for the widget is set to done
==== Reference Shop ==== The reference shop is created by the [[https://git.picalike.corpex-kunden.de/incubator/picalook-middleware/-/blob/main/scripts/reference_shop_to_csv.py|reference_shop_to_csv.py]] in the [[https://git.picalike.corpex-kunden.de/incubator/picalook-middleware|Picalook Middleware]], and than imported by the normal CSV process, you need to create an config in the user collection to make it work ==== Customer Shop ==== The customer shop, to configure, you need to add in the user config the data picalook: True in the mongo document (look at the madeleine DE in the user collection as example). This is important for the lilly_data_from_mongo script in the [[https://git.picalike.corpex-kunden.de/v3/v3-lilly-export|v3-lilly-export]], because if this is true, it gonna generate the 8000XXXX for the lilly-db. This is important for the convertion of the reference looks to customer looks ==== picalook Looks (in reference shop) ==== These looks are created in the Visualytics page, for the “Picalook Shop” that you can select, these looks are saved in the pci_picalook_styles collection in the visualytics data mongo database. The saved data is used to convert them to customer looks ==== transfer picalook looks into customer shop ==== To do this, run the script convert_looks_ref_to_customer.py in the [[https://git.picalike.corpex-kunden.de/incubator/picalook-middleware|Picalook Middleware]], you need to select an shop uid to run the script, this gonna copy the ref looks and do the required changes to be an customer shop looks ===== Frontend =====