ImplyingProgramming / Kamina

IPFS-based decentralized social networking platform
GNU General Public License v2.0
15 stars 6 forks source link

Software frontend discussion #3

Open yatima1460 opened 6 years ago

yatima1460 commented 6 years ago

Do we want to render the pages server-side or not?

emmet-m commented 6 years ago

What sort of front end framework are we going to use? For example, if we use flask everything would really lean towards the back end (with Jinja), but if we have a backend server, we could use something a little more modern (Like Angular) that runs client side, and gets data from the back end. I feel like this question is linked to what framework we pick for front/backend, we'd have to pick two frameworks that work well with each other, or separate them completely

yatima1460 commented 6 years ago

I tried Flask with Jinja and it's pretty good for backend

The problem is the frontend, do we really want to render the page on the client?

I am not aware about the CPU load of frameworks like Angular or React, but what I know is that rendering server-side with JQuery would be lightweight and would run smooth even on mobile devices

jcat4 commented 6 years ago

We should render client side. It’s more efficient that way for the server. If you’re careful and conscience with it, it’s not terrible. Facebook is a bit of a mess, but that’s React

jcat4 commented 6 years ago

Templating is also much more flexible when the rendering is up to the client

TheoryOfNekomata commented 6 years ago

You could prerender pages using React or Angular on the server. Then the pages will be data-bound to the client if they are loaded.

jcat4 commented 6 years ago

Interesting. Maybe default to client side and give users the ability to choose that they want server side rendering?

yatima1460 commented 6 years ago

Facebook is a bit of a mess, but that’s React

I actually would like to know why Facebook is a mess

Is it React or is it because it's badly programmed or is it because of GraphQL?

Are there some benchmarks React VS Angular and so on about performance?

emmet-m commented 6 years ago

I think in addition to taking load off of the server, rendering on the client allows front end devs to build their application entirely without having to touch the backend code. That way a front end dev doesn't have to work with python/whatever framework we use, and doesn't have to open up endpoints to serve/render front end pages.

This also allows us to abstract the back end away from the front end devs further, so if we write a spec up of the endpoints, all they have to do is follow it and not worry about the code. I'm of the opinion that if the code is easy for you to access (i.e. in the same file or directory) then it's all too tempting to look at it. This way allows you to put the front end in an entirely different repository if you'd like!

yatima1460 commented 6 years ago

rendering on the client allows front end devs to build their application entirely without having to touch the backend code

I didn't think about this, good point

Also I thought about creating two separate repos for backend and frontend, anyone could make a different frontend for it meanwhile the backend will stay the same, so it would support mods too

emmet-m commented 6 years ago

Precisely, that way anyone can design their own look/skin/interface from the front end that could be completely different from someone else's, whilst the data processing can remain consistent between applications (which lets users customise their blockchan)

jcat4 commented 6 years ago

That’d also make mobile development way easier. It’d just be designing an interface that displays info received from the backend via REST calls

yatima1460 commented 6 years ago

also we need to discuss about mobile, the system needs to be decentralized otherwise a distributed system (like Blockchain) would be very heavy on mobile

TheoryOfNekomata commented 6 years ago

Is it React or is it because it's badly programmed or is it because of GraphQL?

I bet it's because Facebook uses a lot of polling, causing too much memory consumption. Not sure about the implications of GraphQL as I don't have experience with it yet. Can't say a lot about React's performance, other than having a relatively large file size upon loading.

yatima1460 commented 6 years ago

I created the RFC template in the /rfcs directory, if you want to propose anything like a language or a framework write it and do a pull request