This is my starter app. It is going to be sick.
Get the repo
git clone https://github.com/kljensen/cpsc113-social-todo-node
cd cpsc113-social-todo-node
Install the dependencies
npm install
You'll need to start MongoDB somewhere to store data. And, you'll need to choose a secret for signing browser cookies.
You can run the server with something similar to
PORT=5000 SESSION_SECRET='sdf' MONGO_URL="mongodb://localhost:27017/social-todo" ./node_modules/.bin/nodemon index.js
where your values of PORT
, SESSION_SECRET
, and MONGO_URL
could be different.
If you are on Cloud9, don't set PORT
. SESSION_SECRET
can be whatever you
want.
To see how this app was built, follow these videos. (I should have indexed the videos by commit so that you could rewind this code. That would tough, perhaps next time.) This code passes 31 of the tests in the test suite. It does everything except task completion and deletion. It is roughly 250 lines long, many of which are comments.
(There are MANY ways in which this app could be written. In these videos I wanted to do it from the "hello world code" on the express.js website without using too many fancy dependencies. This is not the fastest or the smartest way to build the app.
- Overview of social todo app
- Running the testing code
- Getting started with node and express
- add view layer to express
- add login forms to views
- handle submitted registration form
- Add mongodb support
- Add form validation
- Add session handling
- Add session persistence and password hashing
- Add tasks
I failed to do a few things in these screencasts. First, I did not show you the git branch-work-commit workflow as well as I should have. Second, once I reached the end, I cleaned up a few things in this commit and I did not record myself doing that. You'll notice that clean up involved adding classes to certain elements and handling a few errors in a way that the end to end grading tests.
You are free to use the code in any way for the first assignment, including as a starting point for your app. This code does not pass tests related to task completion and deletion. You'll need to complete those.