Code Monkey home page Code Monkey logo

todoapp-mean-stack's Introduction

Todo App

Tutorials

  1. https://scotch.io/tutorials/creating-a-single-page-todo-app-with-node-and-angular
  2. Udemy NodeJS course

Requirements

  1. A user can add, edit, and delete 'todos'
  2. Each todo can be marked as complete
  3. Each todo can have an optional file attachment
  4. One person cannot access the todos of another

Project Start

npm init

Development Dependencies

npm install express --save-dev npm install ejs --save-dev npm install body-parser --save-dev npm install mongoose --save-dev

Global Dependencies (for dev)

  1. nodemon

Database

  1. Use Mongo Lab to create a database (https://mlab.com/)

udemy-todo-app

user: max pw: test

Config

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).

Model

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

Controllers

  1. setupController is used for providing seed data
  2. apiController is used for setting up CRUD api

Testing out the API (Postman)

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.

Front end requirements

  1. Assign Angular module and controller
  2. Initialize the page by getting all todos
  3. Loop over the todos
  4. Have a form to create todos
  5. Delete todos when they are checked

Process

Work on next

  1. Add handling so the forms don't except blank or empty.
  2. Study mongoose query syntax more to make sure i understand

todoapp-mean-stack's People

Contributors

medwards147 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.