- https://scotch.io/tutorials/creating-a-single-page-todo-app-with-node-and-angular
- Udemy NodeJS course
- A user can add, edit, and delete 'todos'
- Each todo can be marked as complete
- Each todo can have an optional file attachment
- One person cannot access the todos of another
npm init
npm install express --save-dev npm install ejs --save-dev npm install body-parser --save-dev npm install mongoose --save-dev
- nodemon
- Use Mongo Lab to create a database (https://mlab.com/)
udemy-todo-app
user: max pw: test
Define a config to provide things such as the database connection string (see index.js). Config.json provides settings such as database login credentials (not safe for production obviously).
Setup models by defining a schema for what data you want collected. Use mongoose Schema object constructor.
Create the model using mongoose.model and passing a model name and a Schema
Export the model using module.exports
- setupController is used for providing seed data
- apiController is used for setting up CRUD api
Instead of creating a front-end to test the API, Postman (https://www.getpostman.com/) is a Google Chrome app that allows you to perform http request. This is useful for testing out you api.
- Assign Angular module and controller
- Initialize the page by getting all todos
- Loop over the todos
- Have a form to create todos
- Delete todos when they are checked
- Add handling so the forms don't except blank or empty.
- Study mongoose query syntax more to make sure i understand