Todo Node.JS Project
This project is basic guidelines for a Node.JS beginner.
Objective:
- Create, Retrieve, Update and Delete(CRUD) for todo task.
Technology used for development:
- OS: Ubuntu| Version 14.04
- Database: MongoDB | Version 3.4.10
- Node.js web application: Express
- Browser: Chromium
- HTTP Client CLI: curl
Please prefer the latest version as possible
Alternative OS, Browser and HTTP Client CLI can be used to run this app.
Development
- Understand MongoDB database
- Create a basic Node project
- Routing and HTML page rendering
- Working with database
- Page design with Twitter Bootstrap
- API development
Git branching
- Final app is in master branch
- For each task, branch name with pattern DEV-Task Number, like DEV-1
Using Markdown files
-
mongodb.md to understand DEV-1
-
node_setup.md to understand DEV-2
-
routing.md to understand DEV-3
-
DEV-4 covers:
- CRUD operation
- templating with pug
so, understand both database.md and pug.md
-
It's time to refactor code, so read refactor.md
-
bootstrap.md to understand DEV-5
-
Go to refactor.md, More refactor as need api too
Routes
Route | Method | Response Content Type | Remark |
---|---|---|---|
/users | GET | HTML | Render users list page |
/ | GET | HTML | Redirect to /users |
/users/new | GET | HTML | Render create new user form |
/users/:userId | GET | HTML | Render the user detail page |
/users | POST | HTML | Create new user and Render the user detail page |
/users/:userId/edit | GET | HTML | Render the user edit form |
/users/:userId | PUT | HTML | Update the user and Render the user detail page |
/users/:userId | DELETE | HTML | Delete the user and Render users list page |
/users | GET | JSON | List User |
/users | POST | JSON | Create new User |
/users/:userId | PUT | JSON | Update a user |
/users/:userId | DELETE | JSON | DELETE |