meteor Meteor + React + ReactRouter Step 3- Add Accounts


If necessary, change to your project directory cd MyAwesomeProject

1- Add accounts packages: meteor add accounts-base accounts-password react-meteor-data

2- Add the routes to login and signup pages in imports/startup/Routes.jsx The render() method will be as follows:

  render() {
    return (
      <Router history={ browserHistory }>
        <Route path="/" component={ App }>
          <IndexRoute name="index" component={ Index }/>
          <Route name="login" path="/login" component={ Login }/>
          <Route name="signup" path="/signup" component={ Signup }/>
          <Route name="users" path="/users" component={ Users }/>
          <Route name="editUser" path="/users/:userId" component={ EditUser }/>
          <Route path="*" component={ NotFound }/>


  • I'm skipping some other files that you will need, to make things shorter. Specifically, check imports/startup/server/index.js imports/ui/layouts/{App,NavBar}.jsx and import/ui/pages/{Login,Signup,Users,EditUser}.jsx

  • You can view a full example in Look for tag Step3_Accounts