Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janluksoft/node_express_ts_mssql
The Node CRUD MVC app with the Sequelize ORM MsSql framework
https://github.com/janluksoft/node_express_ts_mssql
crud express handlebars javascript mssql mssql-database mvc-architecture node nodejs rest-api sequelize-orm
Last synced: about 1 month ago
JSON representation
The Node CRUD MVC app with the Sequelize ORM MsSql framework
- Host: GitHub
- URL: https://github.com/janluksoft/node_express_ts_mssql
- Owner: janluksoft
- Created: 2024-02-29T22:53:12.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-03-14T17:26:09.000Z (8 months ago)
- Last Synced: 2024-10-01T07:04:23.622Z (about 1 month ago)
- Topics: crud, express, handlebars, javascript, mssql, mssql-database, mvc-architecture, node, nodejs, rest-api, sequelize-orm
- Language: Handlebars
- Homepage:
- Size: 11.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## The Node CRUD MVC app with the Sequelize ORM MsSql framework
The Node Express CRUD MVC application with the Sequelize ORM database framework and file structure: router, controllers, view, model. The application works with the MsSql database. Sequelize is a modern TypeScript ORM framework for Node.js for fast database communication. Featuring solid transaction support, relations, eager and lazy loading, read replication and more.
.
![](jpg/node-mssql_1_onlinec.gif)## The idea of a web application
This web application demonstrates the use of CRUD actions (Create, Read, Update, Delete) of GET, POST, PUT, DELETE methods by making browser requests to a node server and vice versa.
This application has:
- Express framework;
- JavaScript language;
- Built-in middleware: express.static;
- Partials (layouts) of header, footer
- Handlebars (Hbs) template engine;
- Helpers: [#each], [#if];
- Multi-page portal - switching from the menu;
- Request handling: Get, Post
- Division into file structure:
- Server;
- App_hbs;
- Routers;
- Controller applications (POST, PUT, DELETE method);
- Controller pages (GET method);
- Model of database;
- Views;
- Data class;.
![](jpg/Node_MsSql_14a.png).
![](jpg/Node_MsSql_15b.png)## Operation of the web application
### Good MVC pattern with separation of operations
This application has a good file structure, following the MVC pattern for separating back-end tasks: application, router, controllers, views, models. Many websites are used in large web-apps. Handling multiple pages in one file - causes confusion and lack of order. Therefore, tasks are divided into different folders and files. GET commands are handled by PagesController.js, POST, PUT, DELETE by ApplicationsController.js and separation is handled by: \routes\router.js. Pages are switched via the Get method. The router finds the correct EndPoint and based on it, renders the page to the browser.### Database login
On the Log page - the button sends login data to the Node server using the POST method. To log in to the MsSql server, you need to enter several fields correctly. The server analyzes these login details. If the data is correct - Node will return the data from MsSql for display.### Automatic Sequelize operation
When the required table is not present in the database - you do not need to create the table via SQL query - the Sequelize framework will create this table automatically. This is a great advantage of the Sequelize OMR framework.### Next actions
In the table1 page you can run/use actions: Create, Read, Update, Delete.Original mp4:
![](jpg/Node_MsSql_05b.png)