This is a FullStack Todo Application, the client is based on Todo MVC
- Stack:
- Client: Basic jQuery selectors, event-handlers, DOM manipulation and AJAX
- Web Server: Node and Express with Mongoose
- Database: Mongo hosted by MLab
- Tests: Mocha, Chai, Chai-Http and Chai-Spies
You should attempt to complete this challenge without looking at any other resources such as googling, stack-overflow, documentation or course materials. However, you may look at any of the files in the project including the schema in the models.js
file and the integration tests in test/server.test.js
and you may ask the interviewer clarifying questions at any point.
- If you get stuck, you have 3 lifelines (like "Who Wants to Be a Millionaire")
-
- Online documentation - browse Express, Mongoose, Chai, Chai-Http docs
-
- Interview Hint - Ask the interviewer for a hint
-
- Google search - one time google search including stack-overflow and docs
-
- Go to
mLab.com
and create a new Sandbox database - Create a User for this database:
- Click "Users" tab and then click "Add database user"
- Enter "Username" and "Password"
- Copy the
mongodb://...
URI to the.env
file in this project
DATABASE_URL=mongodb://<USER>:<PASSWORD>@ds112345.mlab.com:12345/<DBNAME>
- Open the "Logs" in this project
- You should see output from 10 integration tests, some will be failing.
- Create a new file name
todosRouter.js
- Move all the endpoints from
server.js
totodosRouter.js
- Require the proper modules into
todosRouter.js
and export the router - In
server.js
, mount the router on/v1/todos/
path (aka mount point). - Remember to update the paths on the router files.
You have completed the task when all the unit tests pass and the client application works without any errors.