Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Frontend w architekturze mikrousługowej Allegro...

Frontend w architekturze mikrousługowej Allegro (aka Opbox od A do .de)

Slajdy z prezentacji na ATM 9, Toruń, 7 września 2016. https://www.youtube.com/watch?v=SKLSYMnmQSo

Avatar for Rafał Żukowski

Rafał Żukowski

October 12, 2016
Tweet

Other Decks in Technology

Transcript

  1. 1 Opbox od A do .de czyli jak organizujemy frontend

    w architekturze mikrousługowej allegro Piotr Orłowski, Rafał Żukowski / Toruń / 7 września 2016
  2. O czym opowiemy 2 Co to jest Opbox Frontend allegro

    przed Opbox Jakie problemy rozwiązujemy Architektura Demo Czego nie pokazaliśmy Zakończenie
  3. Architektura frontendu przed opboxem - Varnish + ESI 5 USŁUGA

    varnish`````````` varnish HTML + ESI <esi:include src="{{{header}}}" /> <esi:include src="{{{footer}}}" /> GET http://allegro.pl/... header-service footer-service HTML
  4. 8 Prototyp 1 2 3 4 5 6 7 8

    9 10 11 12 13 14 { "slots": [], "parameters": [ { "name": "offers", "type": { "typeName": "allegro.offersList" }, "description": "Offers list", "required": true } ], "nameRequired": true, "title": "Offers carousel", "description": "Carousel with offers list" } allegro.offers.carousel 1 2 3 4 5 6 7 8 9 10 11 12 13 { "name": "karuzela", "boxPrototypeId": "allegro.offers.carousel", "version": "1.0", "parameters": [ { "name": "offers", "sourceType": "DATASOURCE", "dataSourceAlias": "oferty" } ], "slots": [ ] } Box
  5. 9 Komponent (web) 1 2 3 4 5 6 7

    8 9 10 11 12 13 14 15 16 import handlebars from 'handlebars'; let mainTemplate = handlebars.compile(fileContent); module.exports = { render(props) { return mainTemplate(viewProperties); }, getAssets() { ... }, handledPrototype() { return { name: 'allegro.offers.carousel', version: '1.0' }; } }; allegro.offers.carousel
  6. 12 Skąd boxy biorą dane? A </> Url Wartość z

    requestu, path parameter lub query parameter Expression Wyrażenie w języku Opel Datasource Dane z usługi Instant value Gotowa wartość np. wpisana w admince
  7. Renderowanie - opbox-core 17 routing page snapshot REST client GET

    /render/page?route=http://allegro.pl/... JSON repozytorium stron request render()
  8. 19 request GET http://allegro.pl/... ciastka, nagłówki, url → GET /render/page?route=http://allegro.pl/...

    repozytorium komponentów (npm) JSON renderowanie HTML opbox-web - renderowanie
  9. 22 wiele gotowych do użycia komponentów mobile sdk warunkowe przekierowania,

    warunkowa strona 404 polityki slotów, sloty krytyczne parametry strony i metadane i inne... Czego nie pokazaliśmy...
  10. Dziękujemy za uwagę 24 - Strona stworzona podczas demo: http://allegro.pl/zobacz/atm-2016

    - Blog http://allegro.tech http://allegro.tech/2016/03/Managing-Frontend-in-the-microservices-architecture.html - Opel http://github.com/allegro/opel - Allegro Tech Talks Poznan #1, 29 września 2016, czwartek, Pixel http://www.meetup.com/allegrotech/events/233789258/