We will build a full-stack solution powered with NodeJS to operate a dynamic cooking blog.To do so, we will implement the backend structure with server-side scripting tools to run a service which produce dynamic web pages. Furthermore, we will build a grid-based layout that is responsive.
First steps, install Nodejs platform . Click Here to Download. To make sure nodejs is installed, open the command promote in windows, or the terminal in Linux operating system. Then, type the following command 'node -v' as following image.
After paying for the source code, you will able to download the Recipe-website.zip file. To run the project, you should extract the Recipe-website.zip and the Recipe.zip. Then, open the folder with one of the prefer editor such as, Visual Studio , intellij or codio. Next, type the following command "cd Recipe-website/Recipe". Finally for this step, insert the "node app.js" command. As demonstrate in the figure down below, the server is ruing the localhost on port 3000. open one of the preferred browser and type either the following URLs; http://127.0.0.1:3000/ , or http://localhost:3000/
login router (/login) : will direct the user to the login page. username and password will be reacquired. The user data should be searched within the JSON file. Also, the JSON will display if the user is authorize or not.
signup router (/signup): will direct the user to the signup page. username, email and password will be required. The user's data will be saved in the JSON file.
project information router ( /about): will the direct the user to the "about" page that showcase the information of the blog . Feel free to add more information.
listing all recipes router ( /recipie/all): will direct the user to all the recipes in the blog with a brief description of every recipe that is listed. The following image visualize the functionality of the page.
recipie's details with the id router (/recipie/details/2): will direct the user to a specific recipe. The details of the every recipe will be fetched from resipeObject.json file.
Admin delete,edit recipie router (/admin/recipie/edit/1 or delete): will direct the Admin to edit and delete recipes as needed.
Add recipie from admin router (/admin/recipie/add): this page will direct the admin to add recipes if need it. to a page that serve the admin can add the information of the new recipe and add it to the blog. The following figures demonstrate the functionality of the page.