Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubt about possible implementations. #191

Closed
francjpd opened this issue Sep 30, 2019 · 2 comments
Closed

Doubt about possible implementations. #191

francjpd opened this issue Sep 30, 2019 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@francjpd
Copy link

francjpd commented Sep 30, 2019

Hello

I apologize in advance if this is not the right place to post this kind of inquiry, i couldn't find a forum / slack / discord out there . :/

I was reading the documentation and the architecture said

there are two types of implementation, storefront & gateway

I assumed i could use puzzleJS by either Storefront, Gateway or both.

I continued to read about the Storefront and the very first line said:

Storefront is the main application that handles requests coming from user's browser

This line made me doubt, so my question is: Does the gateway can live without the Storefront?. or i need the storefront in order to make puzzleJs to work properly.

Cheers

@Acanguven Acanguven added the question Further information is requested label Sep 30, 2019
@cagataycali
Copy link
Member

The answer is; yes but how:
Storefront is passing request to gateways through one path.
Gateways are exposing http endpoint on selected port with little bit complex uri.
Here's quick example with scenario:

Storefront knows which gateways responsible for respond users request.
In demo, we have two of them; browsing and platform gateways.
Just in case, gateways does not knows anything about caller aka storefront.
https://github.com/puzzle-js/multi-project-demo/blob/master/storefront/index.js#L16

Storefront allocating on 4445 port which is depend the other gateways up and running. (http://localhost:4445)

Platform gateway allocating on 4444 port which is depend nobody. ( http://localhost:4444/ )
Browsing gateway allocating on 4443 port which is also depend nobody. ( http://localhost:4443/ )

You can see if you visit http://localhost:4444/footer (Platform gateway - Footer fragment) your response is there and ready to use.

TLDR;

  • Gateways can be used by external callers (without storefront).
  • Storefront can be used without external gateways in static serving cases for example.
  • Storefront and gateways designed for working together, we are using both in that way in production.

Sincerely,
Cagatay.

@francjpd
Copy link
Author

Thank you for the detailed response :D :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants