Skip to content

Commit cc7b24f

Browse files
committed
code linted and formated as per the prettier
1 parent 207c4d6 commit cc7b24f

File tree

10 files changed

+71
-34
lines changed

10 files changed

+71
-34
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ about: Create a report to help us improve
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*.*.*"
6+
- 'v*.*.*'
77

88
jobs:
99
build-and-release:

CODE_OF_CONDUCT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within

README.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Before starting, ensure you have the following installed:
2828
- **Git** - [Download](https://git-scm.com/)
2929

3030
Verify installations:
31+
3132
```bash
3233
node --version
3334
npm --version
@@ -41,26 +42,29 @@ docker compose version
4142

4243
The project uses three environment files:
4344

44-
| File | Purpose | When to Use |
45-
|------|---------|-------------|
46-
| **`.env`** | Local development | Running NestJS locally (outside Docker) |
47-
| **`.env.docker`** | Docker environment | Running with Docker Compose |
48-
| **`.example.env`** | Template file | Reference for creating new environment files |
45+
| File | Purpose | When to Use |
46+
| ------------------ | ------------------ | -------------------------------------------- |
47+
| **`.env`** | Local development | Running NestJS locally (outside Docker) |
48+
| **`.env.docker`** | Docker environment | Running with Docker Compose |
49+
| **`.example.env`** | Template file | Reference for creating new environment files |
4950

5051
### 🔐 Environment File Locations
52+
5153
All environment files are located in: `src/environment/`
5254

5355
---
5456

5557
## 🎯 Initial Setup
5658

5759
### Step 1: Clone the Repository
60+
5861
```bash
5962
git clone <repository-url>
6063
cd <project-directory>
6164
```
6265

6366
### Step 2: Install Dependencies
67+
6468
```bash
6569
npm install
6670
# or
@@ -70,12 +74,15 @@ yarn install
7074
### Step 3: Set Up Environment Files
7175

7276
#### Option A: Local Development (without Docker for app)
77+
7378
1. Copy the example environment file:
79+
7480
```bash
7581
cp src/environment/.example.env src/environment/.env
7682
```
7783

7884
2. Edit `src/environment/.env` with your configuration:
85+
7986
```env
8087
# ===========================
8188
# Application Configuration
@@ -114,12 +121,15 @@ SWAGGER_VERSION=1
114121
```
115122

116123
#### Option B: Docker Environment
124+
117125
1. Copy the example Docker environment file:
126+
118127
```bash
119128
cp src/environment/.example.env src/environment/.env.docker
120129
```
121130

122131
2. Edit `src/environment/.env.docker`:
132+
123133
```env
124134
# ===========================
125135
# PostgreSQL Configuration
@@ -146,34 +156,41 @@ PGADMIN_DEFAULT_PASSWORD=postgres
146156
This runs the NestJS app locally while using Docker for the database only.
147157

148158
#### Step 1: Start Database Services
159+
149160
```bash
150161
npm run docker:up:db
151162
```
152163

153164
This command:
165+
154166
- Starts PostgreSQL container
155167
- Starts pgAdmin container
156168
- Uses configurations from `.env.docker`
157169

158170
#### Step 2: Wait for Database to Initialize
171+
159172
Wait about 10-15 seconds for PostgreSQL to fully start.
160173

161174
#### Step 3: Run Database Migrations
175+
162176
```bash
163177
npm run migration:run
164178
```
165179

166180
#### Step 4: (Optional) Seed the Database
181+
167182
```bash
168183
npm run seed
169184
```
170185

171186
#### Step 5: Start the Development Server
187+
172188
```bash
173189
npm run start:dev
174190
```
175191

176192
The application will be available at:
193+
177194
- **API**: `http://localhost:3535`
178195
- **Swagger Docs**: `http://localhost:3535/api-docs`
179196
- **pgAdmin**: `http://localhost:5051`
@@ -196,6 +213,7 @@ docker exec -it <container-name> npm run seed
196213
## 🗄 Database Management
197214

198215
### Accessing pgAdmin
216+
199217
1. Open browser: `http://localhost:5051`
200218
2. Login with credentials from `.env.docker`:
201219
- Email: `admin@admin.com`
@@ -210,21 +228,25 @@ docker exec -it <container-name> npm run seed
210228
### Managing Migrations
211229

212230
#### Generate a New Migration
231+
213232
```bash
214233
npm run migration:generate -- MigrationName
215234
```
216235

217236
#### Run Pending Migrations
237+
218238
```bash
219239
npm run migration:run
220240
```
221241

222242
#### Revert Last Migration
243+
223244
```bash
224245
npm run migration:revert
225246
```
226247

227248
### Seeding Data
249+
228250
```bash
229251
npm run seed
230252
```
@@ -234,32 +256,37 @@ npm run seed
234256
## 📜 Available Scripts
235257

236258
### Development
259+
237260
```bash
238261
npm run start:dev # Start development server with hot-reload
239262
npm run start:debug # Start with debugging enabled
240263
npm run build # Build the project for production
241264
```
242265

243266
### Production
267+
244268
```bash
245269
npm run start:prod # Run production build
246270
npm run start # Alternative production start
247271
```
248272

249273
### Code Quality
274+
250275
```bash
251276
npm run lint # Lint and auto-fix TypeScript files
252277
npm run format # Format code with Prettier
253278
```
254279

255280
### Docker
281+
256282
```bash
257283
npm run docker:up:db # Start database services (PostgreSQL + pgAdmin)
258284
npm run docker:down # Stop and remove all containers
259285
npm run docker:logs # View container logs
260286
```
261287

262288
### Database
289+
263290
```bash
264291
npm run migration:generate # Generate new migration
265292
npm run migration:run # Run pending migrations
@@ -272,6 +299,7 @@ npm run seed # Seed database with initial data
272299
## 🐛 Troubleshooting
273300

274301
### Port Already in Use
302+
275303
If you see "port already in use" errors:
276304

277305
```bash
@@ -285,19 +313,23 @@ kill -9 <PID>
285313
Or change the port in your `.env` file.
286314

287315
### Database Connection Failed
316+
288317
1. Ensure Docker containers are running:
318+
289319
```bash
290320
docker ps
291321
```
292322

293323
2. Check if PostgreSQL is ready:
324+
294325
```bash
295326
docker logs <postgres-container-name>
296327
```
297328

298329
3. Verify database credentials match in both `.env` and `.env.docker`
299330

300331
### Migration Errors
332+
301333
If migrations fail:
302334

303335
```bash
@@ -313,6 +345,7 @@ npm run migration:run
313345
```
314346

315347
### Docker Build Issues
348+
316349
Clear Docker cache and rebuild:
317350

318351
```bash
@@ -321,6 +354,7 @@ npm run docker:up:db
321354
```
322355

323356
### Permission Denied (Linux/Mac)
357+
324358
```bash
325359
sudo chown -R $USER:$USER .
326360
```
@@ -363,4 +397,4 @@ sudo chown -R $USER:$USER .
363397

364398
**Happy Coding! 🎉**
365399

366-
For issues or questions, please open an issue in the repository or contact the development team.
400+
For issues or questions, please open an issue in the repository or contact the development team.

docker-compose-development.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
container_name: postgres_nestjs_boilerplate
1111
restart: unless-stopped
1212
ports:
13-
- "${POSTGRES_PORT}:5432" # Host port → container port
13+
- '${POSTGRES_PORT}:5432' # Host port → container port
1414
environment:
1515
POSTGRES_USER: ${POSTGRES_USER}
1616
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
@@ -28,7 +28,7 @@ services:
2828
container_name: pg-admin_nestjs_boilerplate
2929
restart: unless-stopped
3030
ports:
31-
- "${PGADMIN_PORT}:80"
31+
- '${PGADMIN_PORT}:80'
3232
environment:
3333
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
3434
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default tseslint.config(
2929
'@typescript-eslint/no-explicit-any': 'off',
3030
'@typescript-eslint/no-floating-promises': 'warn',
3131
'@typescript-eslint/no-unsafe-argument': 'warn',
32-
"prettier/prettier": ["error", { endOfLine: "auto" }],
32+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
3333
},
3434
},
3535
);

nest-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
}
1818
}
1919
}
20-
}
20+
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"license": "MIT",
88
"scripts": {
99
"build": "cross-env NODE_ENV=development nest build",
10-
"lint": "eslint \"{src,libs,test}/**/*.ts\" --fix",
10+
"lint": "eslint \"{src,libs,test}/**/*.ts\"",
11+
"lint:fix": "eslint \"{src,libs,test}/**/*.ts\" --fix",
1112
"format": "prettier --write \"src/**/*.ts\" \"libs/**/*.ts\"",
13+
"format:check": "prettier --check \"src/**/*.ts\" \"libs/**/*.ts\"",
1214
"start": "cross-env NODE_ENV=production node dist/main.js",
1315
"start:dev": "cross-env NODE_ENV=development nest start --watch",
1416
"start:debug": "cross-env NODE_ENV=development nest start --debug --watch",
@@ -108,4 +110,4 @@
108110
"^@seeders(|/.*)$": "<rootDir>/src/database/seeders/$1"
109111
}
110112
}
111-
}
113+
}

0 commit comments

Comments
 (0)