-
Notifications
You must be signed in to change notification settings - Fork 1
PostgreSQL with TypeORM #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
MONGODB_URI= | ||
JWT_SECRET=secret | ||
DB_NAME= | ||
DB_HOST=localhost | ||
DB_PORT=5432 | ||
DB_USER= | ||
DB_PASSWORD= | ||
DB_SCHEMA= |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// module.exports = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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', | ||
// }, | ||
// }; |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add sem to false and tabWidth to 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# NestJS Boilerplate | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
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 | ||
} | ||
} |
There was a problem hiding this comment.
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