Phoenix as a Meteor alternative

Oh forgot to mention… you almost have to remap your caps key to ctrl if you use emacs (I guess thats where it was back in the day anyhow). OSX has a place to do this without any hacks too.

One thing that might be helpful in emacs is to keep notes on what annoys you and then come back later to fix it (different comment shortcut, etc…). My Vim annoy list is rather long lately lol.

I saw someone mentioning this on the Phoenix slack channel:

haven’t tried it or looked at how it works. But it supposedly does SSR with React and Phoenix. Not sure if it works with react router or redux.

1 Like

yeah, I mentioned it, but didn’t try :smile:

yes, I’ve seen many repos, but all of them miss something I need.

I created a demo repo with a todo list and a trello roadmap and will be happy with suggestions, just issues with suggestions or links with info will be great.

1 Like

Happened upon this blog, which shows videos and some more details on the progression of Phoenix stress testing. They kept running out of ports! So damn funny.

Here’s one of the videos showing Phoenix serving 128k clients in a chat room on a 4 core 16gb Rackspace instance.

1 Like

This is pretty slick!

Just a word of warning though. Anytime you try and shoehorn everything into one app like this you’re going to have a ‘Meteor’ problem of ‘how do I do debug in my setup’ as opposed to the industry standard way. It may save a bit of extra work but in my experience i’ve always paid the technical debt in spades later on after the quick setup was done (in the general sense).

Meteor focuses on getting things started quickly and that has issues with configurability vs an easy to start setup. (Grunt/Webpack vs Meteor build for example).

If you really think about it… how often do you ‘create’ these things? prob. a few a year. However, you end up maintaining them daily.

I feel like the old cranky man in the rocking chair now :laughing: … just trying to pass down some reflections of my own mistakes/pain lol.

1 Like

Hmmm… Honestly I haven’t looked into Pheonix. Given that people are now compiling Blaze into React… Is it possible to make Pheonix a low level technology that Meteor installs and manages rather than try to do socket stuff itself? That way it would benefit from all the Pheonix stuff.

1 Like

Hi Everyone, This is a great discussion between meteor and phoenix.

I have a question.

As a complete beginner to web development. Which framework and language would you all recommend spending time to learn that would have the most benefits moving forward?

Meteor + Javascript vs. Phoenix + Elixir

i.e knowing what you now, if you were starting again with a blank slate, which route would you go?

Thanks!

1 Like

If you’re an absolute beginner then Meteor would certainly be better suited to you.

There will be a lot to learn, only issue is that javascript as your first language might end up teaching you bad habits. Everyone has to start somewhere. In my day it was a language called BASIC. Boy did it teach you bad habits!

I would also suggest not just looking for a ‘meteor add’ solution for features but spending actually time trying to figure out how xyz package works. Don’t let the magic become hidden from you.

3 Likes

New tutorial alert - great weekend tutorial for realtime voting app:

2 Likes

that’s a pretty solid advice actually. I have made similar mistakes in the past myself >.<

On a somewhat related note, wonder if it is possible to use phoenix as a backend and meteor as a dumb frontend (e.g. client side code only, no server side code/reactivity/etc.) for the sake of a simple setup to do SSR with React.

I believe SSR is getting first class support in Flow Router 4.0 after reading through its github issues.

1 Like

I finally got around to making a React/Phoenix starter template today! It’s got a whole bunch of goodies:

  1. React
  2. React Router & Redux Router
  3. Redux
  4. Webpack
  5. CSS Modules, CSSNext, PostCSS
  6. Phoenix API
  7. JWT API Authentication
  8. Redux/Channels Example

I still need to do some work on the README to explain how things work and I’m planning on doing a video to explain how it works and some of the design/architectural decisions behind it.

One thing that I’ve noticed about React + Phoenix is that it requires a TON of boilerplate. This is why I created the starter template. In addition, this makes it extremely difficult to do a getting started video that isn’t 3 hours long. Do you think a video on how to use it and how it works would be helpful?

Here’s a link https://github.com/ryanswapp/react-phoenix-starter-template

13 Likes

Yeah, for novices the video will be a HUGE plus. I spent the whole day to make this s.t work, but still didn’t make all things I want.

Can you add the dynamic routing, it is indeed an awesome feature.

@ryanswapp Not everyone has good grip over video tutorials. You do.

Your React + Meteor was done really nicely. Do not worry about the length of the video and make one. It surely will help a lot us to weigh the pros/cons and get a feel for the workflow. Even if you don’t live code, simply explaining the code can be a good option.

3 Likes

Thanks! I’m glad you’ve enjoyed the videos I’ve put out so far. I’ll give the video tutorial a go and see what I can come up with.

@shcherbin I’d love to add dynamic routing/code splitting to the template. I’ll investigate it a little more and see if it makes sense to put it in the template (it may not be given how small the template app is). If not, I’ll try to write up a blog post on how to use it in the context of React/Phoenix.

1 Like

Sure, it will be great. I have some questions:

  1. You still use node js as a backend and phoenix as a second backend api, why not only phoenix?
  2. User situation. For example, we have users and permissions (one to many). As far as I understand, when the user logs in, the token is sent to client and stored. How will you check for user permissions (per route for example, or for action), will you ask it every time from server? Is there a way to grab the user via socket, store it with redux in parent App/Router component and check from this store (and if something will change on server - automatically receive via socket and update) ?

Yep! checkout this repo, it’s a basic chatroom app and Meteor basically sends down the client and it connects to Phoenix. Results are passed into minimongo.
GitHub - AdamBrodzinski/meteor_elixir: An experiment to eliminate bottlenecks in Meteor


> I still need to do some work on the README to explain how things work and I'm planning on doing a video to explain how it works and some of the design/architectural decisions behind it.

@ryanswapp nice! that would be cool if you could cover pushing to production. It’s non-trivial to get some of the other webpack boilerplates to build when pushing to heroku :thumbsup:

1 Like

I think the node server is only for webpack hot loading feature.

1 Like

Yep exactly. The node server allows webpack to connect it’s websocket to html page to provide hot reloads and other stuff.

https://webpack.github.io/docs/webpack-dev-server.html

Maybe yes, need to try :wink:

You still need nginx to run this index.html file and node command to run webpack and generate you js file. I thought, Phoenix will do all the job and send you this template.