Natter is an IRC like chat application. Natter is built using MEAN software stack. In it's current implementation, the app works in the following manner :-
- Instead of a registration route/view, new users are registered when they login with a unique username and a password(of their choice). Thereafter, the user has to login with the same username-password combination.
- A user can view all users registered to Natter DB.
- Upon clicking on a user, one can start chatting with him/her.
The different states(ui-router states) are :-
- userauth - Presents the authorization view.
- home - The home view.
- home.listusers - Lists all the users on the Natter app.
- home.listgroups - Lists the groups. This feature is yet to be built.
- home.natter - Presents the conversation view that allows chatting with another user.
Although, listed in the package.json file, different modules used in the app are -
- express - Well, it wouldn't be a MEAN app without express, would it?
- socketio - Create and handle sockets for bi-directional communication.
- mongoose - Mongoose provides a very easy api to work with mongodb via its schemas and models.
- express-session - Managing user sessions. Sessions are persisted in the database rather than saving them in cookies.
- connect-mongo - Used for storing sessions in DB.
- dotenv - exposes environment variables from the .env file.
- body-parser - Used to access form/json data sent by the client.
- crypto - Lastly, I have used the crypto module for password authentication.
- Using socketio - My first hands on with sockets in javascript. Much easier than sockets in c. Socketio provides a great API to exchange data to-and-forth between the client and server.
- Salt and hashing - For a new user, the passwords are mixed with salt(random bytes) and hashed. Finally the password hash and the salt are stored in the database. On login , the passsword is again salt-and-hashed(salt used from the database). The password hash generated is matched against the one stored in the database to authenticate the user.
- Using the ui-router and ng-animate.