A
A
Alexey Polyakov2017-07-29 11:53:52
JavaScript
Alexey Polyakov, 2017-07-29 11:53:52

Any advice on a web application?

I study programming as a hobby and started my first client/server web application. Selected nodejs even though I was looking at Django. Mustache is chosen as the engine template, jquery will work for the client.
I suppose to give prepared mustache templates: the login page and the main single page page on the client side, plus the initial script for interacting with the server. Next, jquery sends a json request for data by fields, after which it fills the corresponding fields with data and assigns functionality to the buttons.
The template engine and jquery are chosen so as not to overload yourself with the extra functionality of some handlebars or angular 2 and not to go into the study of the superfluous, although probably more convenient, but complicated.
Since I do not yet know the specifics and all the possibilities, please tell me:
1) Is it correct to create a single object that defines the id for buttons, fields for mustache on nodejs, and then, when transferring the same object or part of it to the client, defines the functionality or is it done differently?
2) Is it suitable for single page?
3) How to link HTML on the client for more convenient work with jquery? Id and classes will be convenient to use? I don’t want to write a template, then a separate object, then check that everything is taken into account and corresponds - ideally, I want to write one structure that will give mustache the necessary data for rendering to the node and jquery will then return what concerns it.
4) In terms of styles, do I understand correctly that it is better to make full CSS for fonts, colors and borders on the entire single page and add separate styles when rendering HTML on a node?
5) Does it make sense to use express or is it better to write manually via http.server?
6) If authentication by token is supposed, wouldn’t it be better to generate statics when starting node, and then give each client already static HTML up to the link to the desired index, rather than occupy resources by generating the same one?
That is, the most "complicated" scheme for me at this stage of development is as follows: at startup, node generates several static pages and collects objects for them, then after authentication it passes the appropriate one to each client, then a request comes from the client and scripts are transferred for buttons and data from the database . Further, the exchange of information and recording in the database in the course of the client's work.
ps Although it may make sense to exclude the generation of statics according to clause 6 so as not to get away from the main logic.
There are several projects in my head, so I'm "tormenting" for the time being with the realization of how best, I want to determine everything in advance. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tema_sun, 2017-07-29
@tema_sun

The stream of consciousness is very difficult to penetrate. But what can I say for sure - do not do SPA on jquery. Go crazy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question