aadii104

aadii104

I am working to make Vue-phoenix SSR solution, with some basic start I am getting some queries.
what should be my front-facing server, either Phoenix or Vue?
my points:- for me phoenix suits better coz I am doing ssr and it would be good if I get all the request in Phoenix, process them and deliver the content. Also pheonix is handling my AAA ( authentication and authorisation ).
I need the help of the community to understand this topic or concept deeper.
thanks.

Showing Posts 1 to 10

Nicd

Nicd

Does Vue contain a server? I thought it’s a frontend framework. In any case you should use Phoenix to serve the HTML and the related JS/CSS files. There’s no reason to have two servers on the backend where one can do the job.

acrolink

acrolink

I have developed with both a. Phoenix at front-end and b. VueJS on front-end with Phoenix on back-end including authentication and authorization.

My suggestion based on my experience is to use Phoenix on front end while integrating some VueJS components as needed in the html.eex files (if VueJS is used to render data from the server, then JSON based API end must be used, i.e. render results as JSON to be consumed by VueJS).

hpopp

hpopp

Maybe its a matter of personal taste, but Vue as a standalone SPA (with a phoenix JSON API) is way easier to work with than trying to integrate directly into phoenix. Not to mention the logical separation of concerns (e.g. you can’t just assign everything on a conn and hope for the best).

Edit:
Rereading the question again, why use Vue at all if you want to do purely SSR?

peerreynders

peerreynders

The Benefits of Server Side Rendering Over Client Side Rendering:

That means your browser will start rendering the HTML from your server without having to wait for all the JavaScript to be downloaded and executed. In both cases, React will need to be downloaded and go through the same process of building a virtual dom and attaching events to make the page interactive — but for SSR, the user can start viewing the page while all of that is happening.

hpopp

hpopp

I was under the impression Vue made much more sense for CSR when integrating with phoenix, as phoenix templates + jquery could handle pretty much everything you’d need if you wanted SSR.

sergio

sergio

We have a React clientside app that talks to Phoenix backend with token auth for API access access.

In your case you can have server-side rendering with Phoenix auth (cookie based) and ALSO frontend architecture talking to that API via token auth.

It’s really a balance for you to answer. I don’t recommend going 100% clientside. There are times when a server side rendered page is better, like for example a simple static about us page.

peerreynders

peerreynders

I view SSR as an optimization as your web app is less of a static page with some interactivity (ala jQuery) sprinkled in and becomes more of a SPA towards a progressive web app - specifically targeted to replace a native app on mobile devices. The initial CSR rendering on a mobile device can take long enough for the user to get bored and move on to something else. With SSR the first HTML is already there for the user to view (but not interact with) while JavaScript is still setting things up in the background.

Have a look at the various numbers on Hacker News readers as Progressive Web Apps to see loading times for various SSR/CSR approaches.

That being said Polymer HN does pretty well without SSR.

bulldog_in_the_dream

bulldog_in_the_dream

If you want SSR you can either let Phoenix render all the HTML and sprinkle in JS/Vue where needed, or you can completely decouple the frontend and the backend. In the latter case you acheive SSR using something like Nuxt.js, while the Phoenix app is a pure API serving only JSON.

If I were to make a JS-heavy app I would probably choose a decoupled solution. I think that’s that real question — what kind of app are you building and how much JS will it need.

aadii104

aadii104 OP

sir, I want to use the goodness of Phjoenix and vue, actually it would be a csr + ssr thing.
to keep my code secure from hydration problem, i want to use vue as it handle things pretty well.
thanks for the replay :slight_smile:

gbkbaranee

gbkbaranee

Thanks for your suggestion. Would like to discuss some more details regarding this phoenix - vue ssr setup. Dont want to clutter here. Can we discuss over some private channel - mail/slack or something that’s convenient for you?

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews