02-BloG-It-NoW_WebApp_v2
You can find complete code of this web application here
This Blogging Web Application uses following:
=> Tech Stack:
MongoDB, ExpressJS, NodeJS, HTML, CSS, bootstrap, JavaScript
=> npm packages:
"ejs": "^3.1.6",
"express": "^4.17.1",
"method-override": "^3.0.0",
"mongoose": "^5.12.7",
"nodemon": "^2.0.7"
Now to understand on how to run this app successfully on your localhost, please follow below instructions:
=>
Firstly, please copy/download all the folders and files under https://github.com/SidP919/Web-Development/tree/master/Lecture_15/02-BloG-It-Now_WebApp_v2 and paste/move it to your local project directory/folder.
=>Now, what else you need to run this code:
- Node (14.16.0)
- NPM (7.8.0)
- MongoDB (4.4.5)
=> How to run this code:
1> Make sure MongoDB is running on your system(use command: mongod)
2> Open another window of command line
3> Go to your local project folder path
4> To install dependencies, run
5> To run the application, run
6> Open localhost:3000 in your web browser
See in index.js file for the flow of this BloG-It-NoW Web Application:- index.js
Screenshots of BloG-It-Now Web Application at this point:
Once you have your app setup as shown in above screenshots,
we will add Validation capabilities to our BloG-It-NoW app,
For this, check this link: Bootstrap - Validation - Custom_Styles
Now, create form-validation.js in ./public/js folder
see its code here form-validation.js
now, make changes as we did in new.ejs and edit.ejs inside views folder.
see these 2 files here, new.ejs and edit.ejs
This will add client-side validation to our forms in new.ejs and edit.ejs
Now, create server_side.js in ./public/js folder
see its code here server_side.js
now, make changes as we did in blog_route.js inside routes folder,blog_route.js
This will add server-side validation to our forms in new.ejs and edit.ejs
Now, we will add the Review feature in our BloG-It-NoW app.
For this check the changes in below files:
models/reviews.jsmodels/blog.js
routes/blog_route.js
views/show.ejs
views/see_all_comments.ejs