This project contains configuration & source code files for a node Application
To build and run this app locally you will need a few things:
- Install Node.js 12.x
- Install TypeScript 4.x
- Install MySql 5.6
- Install VS Code
- Clone the repository
git clone https://github.com/mak-ansari/node-express-typescript-mysql.git <project_name>
- Install dependencies
cd <project_name>
npm install
- Run the project | OLD
npm run serve
- Run the project | NEW
npm run start
- Run the project with nodemon
npm run start:watch
- Build the project
npm run build
Finally, navigate to http://localhost:3000
and you should see the api being served locally!
├── node_modules
├── src
│ ├── config
│ │ ├── schema
│ │ │ ├── */schema
│ │ │ ├── mail.
│ │ │ ├── pagination.ts
│ │ ├── db.config.ts
│ ├── controller
│ │ ├── _index.ts
│ │ ├── testController.ts
│ │ ├── .
│ ├── dbo
│ │ ├── _index.ts
│ │ ├── helpers
│ │ │ ├── test.model.helper.ts
│ │ ├── ├──.
│ │ ├── models
│ │ │ ├── test.model.ts
│ │ ├── ├──.
│ ├── helper
│ │ ├── validator
│ │ │ ├── testValidator.ts
│ │ │ ├── .
│ │ ├── responseHelper.ts
│ │ ├── paginationHelper.ts
│ │ ├── .
│ ├── routes
│ │ ├── _index.ts
│ │ ├── testRoute.ts
│ │ ├── .
├── ├── app.ts
├── ├── server.ts
├── .env.example
├── .gitignore
├── chnage.log.md
├── package.json
├── README.md
└── tsconfig.json
node_modules
: Node module packagessrc
: Resource of the applicationconfig
: Business Centre AppSync Resourcesschema
: Schema of varibales.
: Keep adding schema
db.config.ts
: Database configuration
controller
: Common AppSync Resources_index.ts
: Parent router with child route configurationstestController.ts
: Test controller.
: Keep adding other controllers
dbo
: Database operations_index.ts
: Database config & settingshelpers
: AppSync configurationtest.model.helper.ts
: Test model helper.
: Keep adding other model helpers
models
: Database modelstest.model.ts
: Test model.
: Keep adding other models
helper
: Comman helpersvalidator
:testValidator.ts
: add/edit test validation.
: eep adding other validation
paginationHelper.ts
: Get pagingDataresponseHelper.ts
: Lambda functions & configuration [Not in use].
: keep adding other helpers
routes
:_index.ts
: Parent routertestRouter.ts
: Sample test router
app.ts
: Application config & setupserver.ts
: Http Server creator
.env.example
: Environment variables (Create .env file).gitignore
: Git ignore fileschnage.log.md
: Change logspackage.json
: Included Node Packages or ModulesREADME.md
: Project informationtsconfig.json
: TypeScript configuration
In Git there are three default branches:
- dev : development branch
- stage : staging/testing branch
- production : live/master branch
To develop a new feature of your code, create a new branch from dev
called feature/<name_of_feature>
.
Remember to put a tag with the version of your code when you commit on master branch.