BEST PRACTISE: Account-UI for Meteor + React + React Router

Hi guys,

starting from scratch: Meteor + React + ReactRouter.

Need to get accounts working…

Which option do you recon to go with:

Does anyone have some up-to-date experience? maybe @waldgeist

2 Likes

None of the above. In React you just create a form, get the values and call the Login method.
For your convenience, let me share an example from one of my WIPs and the React code for it.
As I use Redux, you will see a call like this.props.signIn(email, password)
This calls an Action in Redux (a function which has the Meteor methods you are familiar with) OK, let me add both files. If you are not familiar with Redux (which you can never regret using) ‘dispatch’ is like a callback.

The example: https://www.activitree.com/signin
The files: here

4 Likes

I’m using https://github.com/royGil/accounts-react, but it took me a while to set this up, and still am struggling with some issues.

1 Like

Thanks for sharing your stuff!

Still searching… can’t believe how hard it is to find a working boilerplate that can handle those things

  • Meteor
  • React
  • React Router
  • Accounts implementation with SignUp LogIn ForgotPassword ResetPassword and transactional Email functionality

And why do you need a boilerplate for that? Just create a meteor react app, add the react router package and use Meteor accounts which has all those functionalities?

Otherwise, you might want to try Pup.

1 Like

I always end up building my own login and registration forms from scratch. It’s not hard, and every project seems to have different requirements anyway, different UI frameworks, different CSS frameworks, etc.

Sometimes I use uniforms to make it a bit easier, but for log in forms, it’s pretty easy to just just wire up the forms in react directly.

2 Likes

I think Pup is very good option to learn from, however I think its over engineered, I have used it before to created a complicated app, and ended up with hundreds of nested components that was pain to keep track of.

1 Like

I see, well it has not been my experience and we also have a large app.

Basically, I’ve divided the app into Meteor packages and using the application structure recommended in the Meteor guide. Personally I think how you divide your component is react/component design decisions and has little to do with the overall application structure which what Pup is providing (at least version 1 from what I recall).

2 Likes

This is the solution for the login issue.

Accounts + React + Uniforms. https://github.com/MeteorDemoApps/Uniforms-UserAccount-demo

Yeah Pup is really nice. Love the Gdpr Stuff and Admin Backend. But I do NOT like the mixed in GraphQl for user management. This is one of the reasons I decided not to go with it (but to keep it as reference to merge features in)

Here’s the template I provide to my students:

Note the videos need to be updated, will do that in the next week.

Philip

2 Likes

Yet another solution - this is what I am modifying to fit my project:

http://www.mrscottmcallister.com/custom-authentication-in-meteor/

It takes a little effort to adapt (especially when like me you’re not using Bootstrap), but then you have the greatest possible flexibility

1 Like