Skip to content

MaYiLagann/node-express-mvc

Repository files navigation

node-express-mvc

Node Specification

Packages

Global Packages

Project Packages

Dev Packages

Express Settings

  • Project created by express-generator
  • View engine: None
  • Style sheet engine: Plain CSS

App Environments

  • Manage the environment using dotenv
  • Modify .env file to update environments

Usages

Initialize the project

  • Install node modules before run project
npm install

Start server with dev mode

  • Run server on localhost with watching file changes using ts-node and nodemon
npm run dev

Start server with dev mode (VSCode)

  • Create /.vscode/launch.json file with the following contents
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch via NPM",
            "request": "launch",
            "runtimeArgs": [
                "run-script",
                "dev"
            ],
            "runtimeExecutable": "npm",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "type": "node"
        }
    ]
}

Linting the source code

  • Run ESLint for typescript codes in project
npm run lint

Testing the test code

  • Run Jasmine with typescript spec codes
  • Write the spec codes in /spec folder
npm run test

Build server

  • Compile application sources from typescript to javascript using tsc in typescript
  • Also, this command copies the /public folder into /dist for build includes the asset files
npm run build

Start server

  • Start server with compiled javascript sources
npm run start

Todo List

  1. Add model validate from request object.
  2. Add scripting tutorial
  3. Add redis handling solution

About

The Node-express server template with TypeScript and MVC architecture

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages