Skip to content

Commit

Permalink
chore: improve project setup and documentation
Browse files Browse the repository at this point in the history
- Add .vscode and todo.txt to .gitignore
- Remove unused dependencies:
  * @faker-js/faker
  * @css-inline/css-inline
  * @css-inline/css-inline-linux-x64-gnu
  * typeorm-extension
- Add PR and issue templates:
  * New PR template with comprehensive checklist
  * Update feature issue template
  * Add new templates for docs, chore, and fix
- Add Swagger JSON endpoint for Postman integration:
  * New endpoint at /api/docs-json
  * Update README with Postman integration guide
  • Loading branch information
JC-Coder committed Feb 27, 2025
1 parent 7e9f092 commit 674788b
Show file tree
Hide file tree
Showing 9 changed files with 238 additions and 11 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/chore--.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: 'chore: '
about: Template for maintenance tasks
title: '[CHORE]'
labels: chore
assignees: ''
---

## Description

<!-- Provide a clear and concise description of the maintenance task -->

## Motivation

<!-- Explain why this maintenance task is necessary -->

## Proposed Changes

<!-- Describe the changes that need to be made -->

## Expected Outcome

<!-- What will be the result after completing this chore -->

## Acceptance Criteria

<!-- List the criteria that must be met for this chore to be considered complete -->

- [ ]
- [ ]
- [ ]

## Additional Context

<!-- Add any other context or screenshots about the chore here -->
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/docs--.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: 'docs: '
about: Template for documentation tasks
title: '[DOCS]'
labels: documentation
assignees: ''
---

## Description

<!-- Provide a clear and concise description of the documentation task -->

## Current Documentation

<!-- Describe the current state of documentation, if any -->

## Proposed Changes

<!-- Describe what needs to be added, updated, or removed -->

## Motivation

<!-- Explain why these documentation changes are necessary -->

## Acceptance Criteria

<!-- List the criteria that must be met for this documentation task to be considered complete -->

- [ ]
- [ ]
- [ ]

## Additional Context

<!-- Add any other context or screenshots about the documentation task here -->
23 changes: 17 additions & 6 deletions .github/ISSUE_TEMPLATE/feat--.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
---
name: 'feat: '
about: Template for feature tasks
title: "[FEAT]"
title: '[FEAT]'
labels: feature
assignees: ''

---

## Description

<!-- Provide a clear and concise description of the feature -->

## Acceptance Criteria

<!-- List the criteria that must be met for this feature to be considered complete -->

- [ ]
- [ ]
- [ ]

## Purpose

<!-- Explain why this feature is needed -->

### Purpose
## Requirements

### Requirem#ents
<!-- List any specific technical requirements for this feature -->

## Expected Outcome

### Expected Outcome
<!-- Describe what the end result should look like -->

## Additional Context

###
<!-- Add any other context or screenshots about the feature request here -->
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/fix--.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: 'fix: '
about: Template for bug fixes
title: '[FIX]'
labels: bug
assignees: ''
---

## Bug Description

<!-- Provide a clear and concise description of the bug -->

## Steps to Reproduce

<!-- List the steps to reproduce the behavior -->

1.
2.
3.

## Expected Behavior

<!-- Describe what you expected to happen -->

## Current Behavior

<!-- Describe what actually happens -->

## Screenshots/Logs

<!-- If applicable, add screenshots or logs to help explain the problem -->

## Environment

<!-- Please complete the following information -->

- OS: [e.g. Windows, macOS, Linux]
- Browser/Device: [e.g. Chrome, Firefox, iPhone]
- Version: [e.g. 22]

## Possible Solution

<!-- If you have suggestions on how to fix the bug -->

## Additional Context

<!-- Add any other context about the problem here -->
66 changes: 66 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Pull Request

## Description

<!-- Provide a brief summary of the changes made in this PR -->

## Related Issue

<!-- Link to the related issue(s) this PR addresses -->

Fixes #(issue)

## Type of Change

<!-- Mark the appropriate option with an "x" -->

- [ ] feat: New feature
- [ ] fix: Bug fix
- [ ] docs: Documentation updates
- [ ] style: Code style/formatting changes
- [ ] refactor: Code refactoring
- [ ] perf: Performance improvements
- [ ] test: Test additions/updates
- [ ] chore: Build process or tooling changes
- [ ] ci: CI configuration changes
- [ ] other: <!-- describe -->

## How Has This Been Tested?

<!-- Describe the tests you ran to verify your changes -->

- [ ] Unit tests
- [ ] Integration tests
- [ ] Manual tests

## Test Evidence

<!-- Please upload a screenshot showing all tests passing -->
<!-- This is required for all PRs that include code changes -->

## Screenshots (if applicable)

<!-- Add screenshots to help explain your changes if UI is affected -->

## Documentation Screenshots (if applicable)

<!-- If you've made code changes, please add screenshots of the updated documentation -->
<!-- This is required for all PRs that include code changes that affect user-facing features -->

## Checklist

<!-- Mark the appropriate option with an "x" -->

- [ ] My code follows the project's coding style
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
- [ ] I have included a screenshot showing all tests passing
- [ ] I have included documentation screenshots (if applicable)

## Additional Notes

<!-- Add any other information about the PR here -->
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,6 @@ dist
*.prod


# User specific ignores
todo.txt
.vscode/
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,36 @@ Here are some useful npm scripts that you can use during development and product
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
- [Express Documentation](https://expressjs.com/)

## API Documentation and Postman Integration

### Swagger Documentation

The API documentation is available through Swagger UI at:

```http
http://localhost:3000/api/docs
```

### Postman Integration

To import the API documentation into Postman:

1. Access the Swagger JSON endpoint:

```http
http://localhost:3000/api/docs-json
```

2. In Postman:
- Click on "Import" in the top left corner
- Select "Link" tab
- Paste the Swagger JSON URL (http://localhost:3000/api/docs-json)
- Click "Continue" and then "Import"

This will create a new collection in Postman with all available API endpoints, making it easier to test and interact with the API.

Note: Replace `localhost:3000` with your actual API host if different.

By following these steps, you should have your Node.js and TypeScript application up and running. If you encounter any issues, please refer to the documentation of the respective tools or seek help from the community.

## API Endpoints
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"postinstall": "npm install --platform=linux --arch=x64 sharp"
},
"dependencies": {
"@css-inline/css-inline": "^0.14.3",
"@css-inline/css-inline-linux-x64-gnu": "^0.14.3",
"@faker-js/faker": "^9.5.0",
"@google/generative-ai": "^0.22.0",
"@nestjs/axios": "^4.0.0",
"@nestjs/bull": "^11.0.2",
Expand Down Expand Up @@ -78,7 +75,6 @@
"speakeasy": "^2.0.0",
"supertest": "^7.0.0",
"typeorm": "^0.3.20",
"typeorm-extension": "^3.6.3",
"types-joi": "^2.1.0",
"uuid": "^11.1.0",
"xlsx": "^0.18.5"
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AppModule } from './app.module';
import { initializeDataSource } from '@database/data-source';
import { SeedingService } from '@database/seeding/seeding.service';
import { ResponseInterceptor } from '@shared/inteceptors/response.interceptor';

import { Request, Response } from 'express';
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule, { bufferLogs: true });

Expand Down Expand Up @@ -45,6 +45,10 @@ async function bootstrap() {
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api/docs', app, document);

app.use('api/docs-json', (req: Request, res: Response) => {
res.json(document);
});

const port = app.get<ConfigService>(ConfigService).get<number>('server.port');
await app.listen(port);

Expand Down

0 comments on commit 674788b

Please sign in to comment.