if mysql database How to update SQL (MySQL, PostgreSQL, SQL Server) database to DhiWise through VS Code? (New update) Copy the VS Code extension token from the platform and paste it into the access token field. Fill all the required SQL credentials That's it. Your SQL Database's Tables are added as Models in your application π₯³
if postgres database server port username password
Supported version of nodejs >= 12, Supported version of mongoose >= 6
Version of displayed code:v1.0.1 Last build version:v1.0.1 Code architecture:MVC
CLI Quickly generate Node APIs and models. Installation Install DhiWise Node generator with the following command. npm i -g @dhiwise/node-generator
Create Model Create a single model file in the directory. dhi create-model
Crete API Create a single API in your specific module or platform. dhi create-api
Create Module This module will contain controller, CRUD operations, and other features. dhi create-module
Create Application Create boilerplate application. dhi create-app
ooops ntegrate your source code to GitHub or GitLab or download the source code. Download source code Synced with GitHubBranch name:altlokalt/ecombackend Repo URL:https://github.com/altlokalt/ecombackend Commit
API document Access your API documentation viewdocument blob:https://app.dhiwise.com/495773bf-fd7c-4dff-8647-85d6d5e662c6 or get the zip postman-collection from https://app.dhiwise.com/node/dashboard/641eaee842eacd0014b95eae or uploaded in google doc
- This is a Node application, developed using MVC pattern with Node.js, ExpressJS, and Mongoose.
- MongoDB database is used for data storage, with object modeling provided by Mongoose.
-
$ npm install
-
$ npm start
-
Credentials
- One user with User role,
username : Caleb.Erdman69 password : QpPCXqEiR8eGjOj
- One user with Admin role,
username : Virgil.Jacobi19 password : H97DmukSybXgJTz
Click here to visit documentation
- if you have docker file you can execute following command
- build the image
$ docker build --pull --rm -f "Dockerfile" -t <imageName>:latest "."
- execute the command
$ docker run -p 3000:3000 <imageName>
βββ app.js - starting point of the application
βββ config
β βββ db.js - contains api database connection
βββ constants - contains commonly used constants
βββ controllers
β βββ platform - contains business logic
βββ jobs - cron jobs
βββ models - models of application
βββ postman - postman collection files
βββ routes - contains all the routes of application
βββ services - contains commonly used services
βββ views - templates
βββ utils - contains utility functions
- app.js
- entry point of application.
- config
- passport strategy files
- database connection files
- constants
- constants used across application.
- controllers
- Controller files that contains Business logic
βββ controller
βββ platform
βββ modelNameController.js - contains CRUD Operations
- jobs
- Cron jobs
- middleware
- Middleware files for authentication, authorization and role-access.
- models
- Database models
- postman
- Postman collection of APIs (Import this JSON in Postman to run the APIs)
- public
- Assets used in application
- routes
βββ routes
βββ platform
βββ modelNameRoutes.js - contains CRUD operation routes
βββ index.js - exports model Routes
βββ index.js - exports platform routes
- index.js file, exports platform routes, imported into app.js to access all the routes.
- services
βββ services
βββ jobs - cron jobs
βββ auth.js - Authentication module service
- utils
βββ utils
βββ validations - joi validations files for every model
βββ dbService.js - Database functions
βββ messages.js - Messages used in sending response
βββ responseCode.js - response codes
βββ validateRequest.js - validate request based on model schema
- env files
- You can add credentials and port, database values as per your environment(Development/Production).
- If you are running test environment then test cases will run using test database,and its configuration is there inside app.js
VS Code extension Download our VS Code extension to access and sync your application code directly to your VS Code IDE. Application token - https://app.dhiwise.com/node/dashboard/641eaee842eacd0014b95eae eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNjNmNTg4ZDIyNWUyMmUwMDIzODQ5YWRiIiwiX2lkIjoiNjNmNTg4ZDIyNWUyMmUwMDIzODQ5YWRiIn0sImNvbXBhbnlJZCI6IjYzZjU4OGQyMjVlMjJlMDAyMzg0OWFkZCIsImFwcGxpY2F0aW9uSWQiOiI2NDFlYWVlODQyZWFjZDAwMTRiOTVlYWUiLCJpYXQiOjE2Nzk3MzI0NTl9.AnfuL-PtUpn6aW383ciZe3J5bxqwqCiV6nPxoL1UDYs
Deploy application Deploy your code on sandbox or production. Deploy on production Take your app to production and beyond with a click. key 9add-5eae.dhi.codes
Deploy on sandbox Test your APIs before taking it to live. https://b95eae-kend-sandbox.dhiwise.co key b95eae-kend-sandbox.dhiwise.co