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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

webofbits
Cairn is a small OTP library for message delivery, lightweight function processes, supervised work, and waiting on results. The goal is ...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews