Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions 03-postgres-typeorm/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MONGODB_URI=
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if you can add the env file gitignore and change it to sample.env

JWT_SECRET=secret
DB_NAME=
DB_HOST=localhost
DB_PORT=5432
DB_USER=
DB_PASSWORD=
DB_SCHEMA=
25 changes: 25 additions & 0 deletions 03-postgres-typeorm/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// module.exports = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is commented?

// parser: '@typescript-eslint/parser',
// parserOptions: {
// project: 'tsconfig.json',
// tsconfigRootDir: __dirname,
// sourceType: 'module',
// },
// plugins: ['@typescript-eslint/eslint-plugin'],
// extends: [
// 'plugin:@typescript-eslint/recommended',
// 'plugin:prettier/recommended',
// ],
// root: true,
// env: {
// node: true,
// jest: true,
// },
// ignorePatterns: ['.eslintrc.js'],
// rules: {
// '@typescript-eslint/interface-name-prefix': 'off',
// '@typescript-eslint/explicit-function-return-type': 'off',
// '@typescript-eslint/explicit-module-boundary-types': 'off',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add the prettier rule here like single route to true etc

// '@typescript-eslint/no-explicit-any': 'off',
// },
// };
39 changes: 39 additions & 0 deletions 03-postgres-typeorm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# compiled output
/dist
/node_modules
# .gitignore


# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output



# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
4 changes: 4 additions & 0 deletions 03-postgres-typeorm/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add sem to false and tabWidth to 2

96 changes: 96 additions & 0 deletions 03-postgres-typeorm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# NestJS Boilerplate
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be great if we add the projects modules description like what this project have functionality which will really help other developer better understanding of how to use the code


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some more details here to describe the project's core features.

This is a powerful NestJS boilerplate for building scalable and enterprise-level applications. It includes robust features such as proper logging mechanisms, JWT-based authentication, OpenAPI documentation, and PostgreSQL setup with TypeORM. You can use this boilerplate as a solid foundation for projects that need to scale to millions of users.

## Getting Started

Follow these simple steps to get your project up and running:

### Prerequisites

Before you begin, ensure you have met the following requirements:

- Node.js installed (v18+ recommended)
- PostgreSQL with Pgadmin installed and running
- Git installed
- A code editor of your choice (e.g., Visual Studio Code)

### Installation

1. Clone the repository:

```bash
git clone

```

2. Change to the project directory:

```bash
cd nestjs-boilerplates/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the route to your project


```

3. Update values of `.env` file according to your configuration needs. The `.env` file is used to store environment-specific variables.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you add the sample.env and update this too


4. Install project dependencies:

```bash
npm install

```

### Development

To start the development server, run the following command:

```bash
npm run start:dev

```

This will launch your NestJS application in development mode.

### Production
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have this functionality to separate the env files for prod and dev, if not then please remove this


For production deployment, you should set up your server using a process manager like PM2, Docker, or your preferred method. Remember to configure the production environment variables in a `.env.prod` file.

## Features

- Proper Logging Mechanism
- JWT-Based Authentication
- OpenAPI Swagger Documentation
- PostgreSQL and TypeORM configuration with Entities creation

## Usage

This boilerplate is equipped with a simple CRUD for two entities User(Employee) and Employer that shares a common auth module. The PostgreSQL database is used with TypeORM for interacting with database.

## Documentation

The API documentation is available through Swagger UI. Once your server is running, access it at:

```sh
http://localhost:5000/v1/swagger

```

## Contributing

We welcome contributions from the community. To contribute to this project, follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and ensure tests pass.
4. Commit your changes and push to your forked repository.
5. Create a pull request to the main repository.

Please review our [Contributing Guidelines](../CONTRIBUTING.md) for more details.

## License

This project is licensed under the MIT License - see the [LICENSE.md](../LICENSE.md) file for details.

## Contact

If you have any questions or issues, please feel free to [create an issue](https://github.com/CodeAshing/nestjs-boilerplates/issues) in our repository.
8 changes: 8 additions & 0 deletions 03-postgres-typeorm/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading