Answer the question
In order to leave comments, you need to log in
Online store on Falcon and VueJS?
Hello. There is an idea to create an online store on python3 falcon on the backend and vuejs2 on the front. On falcon, create an api for receiving goods, for example, and on vuejs, configure routing and rendering through this api. Knowledgeable people, tell me what problems there may be when creating such a project and is it even possible to implement this?
Answer the question
In order to leave comments, you need to log in
The scheme you described, in which the application is divided into two parts: client-side in JS and server-side, which exchange data through an open API over HTTP, is called Rich Internet Application or Single Page Application. Implemented on any stack. PHP/Python/NodeJS/Ruby/Go/C#/Java et al on one side and Vue/Angular/Meteor/React et al (thousands of them) on the other.
(Mentioning the "microservice architecture" scheme, in fact, the decomposition of the server part into independent modules with an open API, it is not at all necessarily implemented via HTTP. A special case of SPA / RIA.)
I will name one problem. Only she does not give rest. It exhausts the soul, nerves and wallet.
The online store must be open for indexing by search bots, and the HTML is generated at runtime in JavsScript. Only Google knows how to execute JS, and that is very mediocre. The rest do not touch JS at all. There are two solutions:
for indexing, immediately draw HTML on the server side
or take "fingerprints" of HTML from the application through a virtual browser, which will fail. HTML rendering on the
server
side (server side render) can be implemented in three ways:
that is, instead of templating in Vue, draw in Falcon - damn it, two templating, two logics for working with data (via AJAX and directly from the database)
* simulate JS execution on the server (hmm, this is possible again in several ways) - there’s generally dancing with a tambourine
* abandon PHP / Python / Ruby, etc. in favor of NodeJS and an isomorphic framework, such as MeteorJS or VueJS (Nuxt)
If you screw up the rendering for search engines and refuse organic traffic, then you can ignore my opus about this problem. Traffic can be more than just organic. It can be driven through contextual or teaser advertising, through social networks, through media or offline advertising. Depends on the size of the project owner's wallet.
PS About Google: checked, buggy in those places where client JS starts uploading data via HTTP - Google stops rendering and empty HTML pages are in the search index. There is no sense from them.
PPS HTML fingerprinting for SPA can be done through special services (prerender.io or brombone.com) or done independently, for example, through PhantomJS or Electron. In any case, for a project with tens of thousands of pages, this is the cost of paying for the service, or for a powerful server. Both the electron and the phantom hang, and the HTML is quite large and clogs the disk / database over time. Again, we must not forget that the pages require data loading via AJAX, you have to wait a bit.
Example: web-mastery-gauge.ru is made on Angular, for search engines HTML is rendered through prerender.io - for a project with 15 pages, this does not cause any difficulty at all.
PPPS SPA is just perfect for implementing that part of the user interface that is not indexed by search bots. For example, it is available only to authorized users. In this case, server side render is not required and 75% of the problems disappear. In the same online store there may be an admin panel - it can be done on VueJS.
Why Falcon and not Django? Do you want to build a microservice architecture? Otherwise, it's still better to take Django, which will reduce bicycle building, many things have already been done there.
And most importantly, SEO is usually important for online stores, which means that if javascript is not synchronous, then most likely there will be some difficulties. This means that for some of the pages you need to use server-side rendering .
And so, of course, you can make an interactive store application, there shouldn't be any other big problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question