{"id":22462949,"url":"https://github.com/ashutosh7i/learning_mvc-node-express","last_synced_at":"2026-04-07T07:35:38.728Z","repository":{"id":159387595,"uuid":"634497282","full_name":"ashutosh7i/Learning_MVC-Node-Express","owner":"ashutosh7i","description":"Started learning MVC with Node\u0026Express, this repository contains all the work i done. A kind of backup.","archived":false,"fork":false,"pushed_at":"2023-04-30T20:23:04.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T14:25:00.718Z","etag":null,"topics":["ejs","expressjs","learning-resource","mongodb","mvc-architecture","mvc-pattern","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashutosh7i.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-30T10:17:02.000Z","updated_at":"2024-08-29T06:28:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"5187026e-a64f-4678-8558-b73be01fa3e9","html_url":"https://github.com/ashutosh7i/Learning_MVC-Node-Express","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ashutosh7i/Learning_MVC-Node-Express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutosh7i%2FLearning_MVC-Node-Express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutosh7i%2FLearning_MVC-Node-Express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutosh7i%2FLearning_MVC-Node-Express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutosh7i%2FLearning_MVC-Node-Express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashutosh7i","download_url":"https://codeload.github.com/ashutosh7i/Learning_MVC-Node-Express/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutosh7i%2FLearning_MVC-Node-Express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ejs","expressjs","learning-resource","mongodb","mvc-architecture","mvc-pattern","nodejs"],"created_at":"2024-12-06T09:11:47.312Z","updated_at":"2026-04-07T07:35:38.707Z","avatar_url":"https://github.com/ashutosh7i.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning_MVC-Node-Express\nStarted learning MVC with Node\u0026amp;Express, this repository contains all the work i done. A kind of backup.\n\n# What is MVC?\nMVC stands for Model View Controller.\nMVC is a Applicaton designing Architecture used to standerize an application for production level, by using MVC your application becomes more easy to develop with a team.\nMVC is a industry standard and a Best Practise.\n\n![](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/routes/mvc_express.png)\n\n\n## Model\nModel handles the database part of an application, its main task is to interact with a database/storage and read/write data to it, a model is accessible by Controller.\n\nThe model determines how a database is structured, defining a section of the application that interacts with the database. This is where we will define the properties of a user that will be store in our database.\n\n## View\nView handles the presentation part of an applicaion, its main task it to create presentation for the user using the data provided by the controller, it used a template for this process.\n\nThe view is where end users interact within the application. Simply put, this is where all the HTML template files go.\n\n## Controller\nThe controller interacts with the model and serves the response and functionality to the view. When an end user makes a request, it’s sent to the controller which interacts with the database.\n\nYou can think of the controller as a waiter in a restaurant that handles customers’ orders, which in this case is the view. The waiter then goes to the kitchen, which is the model/database, and gets food to serve the customers, which is the controller handling the request.\n\n## Routes\nRoute folder contain routes for diffrent endpoints of an application.\n\n# Work-Flow.\nThe whole flow is described in the index.js file of an app, it is the entry point for any MVC application.\nFirstly the request is handles by the routes, routes is an index file that handles all request sent to the server,\nThen the routes pass the request to the appropriate controller.\nContoller then uses its internal logics to process the request,it interacts with the model.\nModel is uses to fetch and send back information to the database,and then to controller.\nController then processed the information and sends it to views.\nViews create a presentation for that information.and sends the presentation (HTML) back to the controller,\nAnd at last, the controller shows the information back to the user.\nThis is the working flow of a MVC application.\n\n# Implementation in Express\u0026Node.\nA Standarized MVC Application looks like this-\n[ the repo 😂]\n\nThe requests can be sent to this server/app,\n* send a GET request to localhost:3000/users to get all users.\n* send a POST request to localhost:3000/users to add a new user.\n* send a DELETE request to localhost:3000/users to delete a user.\n\n## Flow in our Application-\n* Server is started from index.js, then index.js tells routes to handle upcoming requests,\n* Routes handles types of request and tells the respective controller to process the request,\n* Contoller handles the request and uses diffrent models to manipulate the data,\n* Models works with database(inbuilt here) \u0026 gives response to controller,\n* Views (router again here) makes presentation \u0026 gives response to controller.\n* Controller sends the presentation back to user using routes.\n\n# Notes-\n1. Any middleware required/imported on the main index.js page, will be availble to any page which will have instance to main page.\neg- the express.json allows to pass the request body(req.body.anyJsonKeyName).\nwithout it we wont be able to parse it, in the controller page, we needed it, but we didnt required it, it worked out of the box. more on that page.\n2. The app.route(...) chainable handler \u0026 the express.Router() class can be chained together, to make chainable request handler and exported simultaneously.\nas done it routes.\n\n### This is what i learnt about MVC in a day, remained confused for a while about MVC before today, but after implementing it today, everything is crystal clear✨\n## Hope it helps.😉🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashutosh7i%2Flearning_mvc-node-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashutosh7i%2Flearning_mvc-node-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashutosh7i%2Flearning_mvc-node-express/lists"}