This demo application demonstrates how user authentication can be added to a simple web app using UserApp. It's based on the AngularJS version of TodoMVC and changes has been made to enable user log in, sign up and persistent storage of the todos with Node.js and MongoDB.
Go to https://app.userapp.io/#/sign-up/ and sign up for a UserApp account.
Download the demo application to your computer and unzip it.
Install the document database MongoDB. You find all the instructions here: http://docs.mongodb.org/manual/installation/.
Download and install Node.js from here: http://nodejs.org. Then download and install npm: https://npmjs.org.
# npm install express
# npm install mongoskin
Open server.js and app/js/app.js and insert your own UserApp App Id (search for "YOUR-USERAPP-APP-ID"). How do I find my App Id?
node server.js
Open a new browser tab and go to http://localhost:3000.
- UserApp handles the sessions which are created from the client side using JavaScript.
- When a user logs in a new session token is returned from UserApp.
- When retrieving and persisting todos, the token is sent along with the request to the Node.js backend.
- The Node.js server checks that the token is valid and uses the user's id to get and store the todos.
- The server caches these requests up to 10 minutes. This way minimal requests and roundtrips are done to UserApp.
- Create a permission that give users the right to create new todos, or just read them.
- Add functionality to reset the password. Hint: this must be done from the Node.js backend.
- Sign up or log in to UserApp
- UserApp Website
- UserApp Documentation
- UserApp Support Center
- TodoMVC Website
- AngularJS Website
Everything in this repo is MIT License unless otherwise specified.
TodoMVC:
MIT © Addy Osmani, Sindre Sorhus, Pascal Hartig, Stephen Sawchuk.
Node.js backend and incremental changes:
MIT © Timothy E. Johansson
If you find any bugs or have any issues getting the demo app to run, please let us know.