Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mattkeehan/angular-node-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sky - Find & Watch Team Test

Install

npm install

set up a mongo connection in the .env file.

Test

mocha

Run

node main

Environment

Built using node 0.10.33 on Windows

Notes

I've built it very minimally, to fulfil only the stated requirements. Tried to keep all business logic to the backend, so the only (mocha) unit tests are there too. Karma could otherwise be used for front end testing.

I keep my code as simple as possible until there's a reason not to, but changes I would expect to make soon if I continued would be: Fail gracefully if mongo is unavailable; View over https; Create authorisation middleware; Add some nice frontend default styling; improve the auth attempts json feed view (probably restructure on the backend so the frontend could still view it naively); Add casperjs frontend end-to-end testing; Add proper logging.

alt text

Requirements

Create an angular app which allows a user to enter a username and password and authenticate. Successful authentication should provide the user with a logged-in page and the ability to log out.

Create a NodeJS app which provides an authentication API to your angular app. The usernames 'user', 'manager', 'admin', 'developer', 'tester', with the password 'password' should be authenticated. All other combinations should fail. Eg, username 'john.smith' can never authenticate.

Usernames should be case-insensitive, passwords should be case-sensitive.

Authentication attempts should be recorded (preferably in a Mongo database, although any other persistence of your choice is acceptable), with the following data:

  • IP
  • Datetime (unix timestamp format)
  • Action (should be one of AUTH_SUCCESS or AUTH_FAILURE)
  • Username

Expose a JSON feed of the authentication data to authenticated admin users only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%