-
Notifications
You must be signed in to change notification settings - Fork 21
Tasks
Install Node.js and Git. When installing Git for Windows, it'll ask you lots of questions. Don't worry, the defaults are fine.
Once you have Node.js, you'll want to install the grunt command line interface globally. Grunt is a task runner. Read their getting started guide for more details. To install, run
$ npm install -g grunt-cli
in a terminal window.
You'll also need to install the project's dependencies. Run
$ npm install
from the project's root folder.
To run the tests, you'll need Chrome and the latest version of the Selenium Chromedriver. Put the Chromedriver somewhere on your PATH (I put it in C:\Windows\System32
).
For development, you'll want to run a local version of the server so that you can test your changes immediately. To do this, run
$ node server
in a terminal window.
Note, however, that if you make a change to the server's code, you'll need to restart the server. You can stop the server by pressing Ctrl-C
.
Remember to read the Rules before starting.
- Play with the REST API.
- Add a TODO item via the API. * Install the Postman app * RESTful tutorial
- Get the list of TODOs via the API.
- Delete your TODO item via the API.
- Get the list again to check the item was deleted.
- Change the colour of header.
- Install Chrome. (Just kidding, you've done this already, right?)
- Use the Chrome developer tools (
F12
) and inspect the header. - Change the colour directly in the tools and see the page update.
- Once you're happy, copy the colour into the CSS file in a text editor.
- Commit your change and make sure it's deployed to Heroku.
- Interactive git tutorial
- Learn git branching
- Git book
- Don't forget to check the build's progress on CircleCI. You'll get an email notification if the build fails.
- Replace
filter
with_.find
in thegetTodo
function inserver.js
.
- Add Underscore.js as a dependency
- Import
_
intoserver.js
_.find
documentation- Run
grunt
to check that the tests still pass.- You'll want to run
grunt
often to make sure you're not breaking the build.
- You'll want to run
- Add the ability for users to delete TODO items.
- Give each TODO item in the UI a delete button. Use JavaScript to add a
button
element and attach it to theli
element. - Make the delete button calls the server API.
- Add some style for the delete button.
- Refresh the list of TODO items when the response comes back.
- Handle the case that the request fails.
- To keep the build passing, you'll need to add some end to end tests.
- The tests can be found in
tests/e2e.js
. - Selenium introduction
- Selenium JavaScript API
- The tests can be found in
- Add update functionality to the API. You don't need to change the UI to support updating.
- Updates in REST
- It should return 200 if successful.
- You should decide what to do if the resource didn't previously exist. Should it create the resource (201) or tell the caller that the resource doesn't exist (404)?
- Add the ability for users to mark TODO items as complete.
- Add an
isComplete
field to new TODO items that is set tofalse
. - Add a complete button next to each TODO item.
- Make the complete button call the update API setting the
isComplete
field totrue
. - Update the code that displays TODO items to check the
isComplete
field and change the style of the TODO item.
- Add a label telling the user how many items there are left to complete.
- Add a
<div>
between the header and first section in the HTML. - Give the
<div>
theid
ofcount-label
. - Store the DOM element for the
<div>
at the top ofmain.js
usingdocument.getElementById
. - Update the
textContent
of the DOM element whenever we refresh the TODO list. - Remember, you should only count items that aren't complete.
- Add a button, "Delete completed", to delete all complete TODO items.
- Only show the button if there are complete items.
- Make the buttons in the app follow a consistent style.
- Add a
button
class to the CSS file. - Apply the
button
class to the various buttons in the HTML file. - Make buttons have rounded corners.
- Give buttons a drop-shadow.
- Add buttons to filter TODOs on their status (all, active, completed).
- Replace
XmlHttpRequest
with the newer Fetch API.
- Install and include the fetch polyfill in
index.html
. - Introduction to fetch
- Poll the server for updates.
- Add a grunt task,
serve
, to run the server.
- Add a grunt task,
watch
, to watch for any file changes inserver/
and restart the server. - Make the UI pretty. Impress us 😃