CMS (Content Management System) , users can visit the website to gain knowledge about the topic of their interest and other topics .Where the contents are managed by the admin. Admin add new content , Update the details in the content , and also remove the content. Admin need to login to Admin panel to access the features.
• Node-Js • Express-Js
• HTML • CSS • Js • EJS
• MongoDB
• Install required node modules. • Node Modules Used: Mongoose EJS Express Passport
• Setup the required packages. • Use get() to show the result for provided URL • Use Post() to take the values from post request from the forms
• Create Ejs files which contains HTML and Js for rendering and Displaying the results. • Style the HTML using CSS files. • Connect Ejs files to Node using render().
• Connect node to database using mongoose • Create mongoose Schema which contain the structure for the table • Store the data in database and retrieve data from database as per the requirement.
• For authentication of Admin use passport.js packages • Which check the data entered from login page with database
• Create a Admin panel which consists of two text fields one for Title And another Content. • Which make a post request when submit button is clicked. And the data will be stored in database and reflected in home page.
- At www.website.com/ which will redirect to main page of the website where users can get/view the contents
- Main page shows title and content of around 500 words , for more / full detail by clicking Read More of the required content ,page will be redirected to the detailed content pages Examples: url look like www.website.com/post/60ddd8309d2b4934904e70de
- When www.website.com/admin is called and if the admin is not logged in ,page will be redirected to Login page www.website.com/admin/login , which take username and password and crosscheck with the database admin details
- If the Admin is logged in and authenticated www.website.com/admin will be called and Admin can use the admin panel, where admin can Publish new post/content and delete the existing post/contents.