forked from swapnil.bendal/TypeScript-Backend-Template
[update] - Readme file and ecosystem config file
This commit is contained in:
88
README.md
88
README.md
@@ -1,7 +1,85 @@
|
||||
# Awesome Project Build with TypeORM
|
||||
# **TypeScript Backend Template**
|
||||
|
||||
Steps to run this project:
|
||||
---
|
||||
|
||||
## **Table of Contents**
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Scripts](#scripts)
|
||||
- [License](#license)
|
||||
|
||||
---
|
||||
|
||||
## **Installation**
|
||||
|
||||
### **Prerequisites**
|
||||
- [Node.js](https://nodejs.org/) (version 14 or higher recommended)
|
||||
- [npm](https://www.npmjs.com/) (bundled with Node.js)
|
||||
|
||||
### **Steps**
|
||||
1. Fork the repository to your GitHub or GitLab account.
|
||||
2. Clone your forked repository:
|
||||
```bash
|
||||
git clone https://<your-git-account>/TypeScript-Backend-Template.git
|
||||
```
|
||||
3. Navigate to the project directory:
|
||||
```bash
|
||||
cd TypeScript-Backend-Template
|
||||
```
|
||||
4. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## **Usage**
|
||||
|
||||
### **Development Mode**
|
||||
1. Start the development server:
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
2. Open your browser and navigate to:
|
||||
```
|
||||
http://localhost:3000
|
||||
```
|
||||
|
||||
### **Production Mode**
|
||||
1. Install [PM2](https://pm2.keymetrics.io/) globally for process management:
|
||||
```bash
|
||||
npm install pm2 -g
|
||||
```
|
||||
2. Start the production server:
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## **Environment Variables**
|
||||
|
||||
Create a `.env` file in the root directory based on the structure of [`.env.example`](.env.example).
|
||||
|
||||
---
|
||||
|
||||
## **Scripts**
|
||||
|
||||
| Script | Description |
|
||||
|---------------------|-------------------------------------------------------------|
|
||||
| `npm start` | Starts the app in production mode using PM2. |
|
||||
| `npm run dev` | Starts the app in development mode with `nodemon`. |
|
||||
| `npm run test` | Starts the app in test mode with `nodemon`. |
|
||||
| `npm run lint` | Runs ESLint to check for code quality issues. |
|
||||
| `npm run lint:fix` | Fixes fixable issues detected by ESLint. |
|
||||
| `npm run prettier` | Checks code formatting using Prettier. |
|
||||
| `npm run prettier:fix` | Formats code files according to Prettier rules. |
|
||||
| `npm run prepare` | Prepares Husky for managing Git hooks. |
|
||||
|
||||
---
|
||||
|
||||
## **License**
|
||||
|
||||
This project is licensed under the [MIT License](LICENSE).
|
||||
|
||||
1. Run `npm i` command
|
||||
2. Setup database settings inside `data-source.ts` file
|
||||
3. Run `npm start` command
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
{
|
||||
"apps": [
|
||||
{
|
||||
"name": "Typescript-Backend",
|
||||
"script": "src/index.ts",
|
||||
"instances": 1,
|
||||
"autorestart": true,
|
||||
"watch": false,
|
||||
"time": true,
|
||||
"env": {
|
||||
"NODE_ENV": "production",
|
||||
"PORT": 3000
|
||||
}
|
||||
}
|
||||
]
|
||||
"apps": [
|
||||
{
|
||||
"name": "Typescript-Backend",
|
||||
"script": "npm",
|
||||
"args": "run start",
|
||||
"instances": 1,
|
||||
"autorestart": true,
|
||||
"watch": false,
|
||||
"time": true,
|
||||
"env": {
|
||||
"NODE_ENV": "production",
|
||||
"PORT": 3000
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user