Skip to content
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

[New API] : NEST Js + Type ORM + Postgres SQL +JWT API #114 #130

Merged
merged 1 commit into from
May 23, 2024
Merged
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
25 changes: 25 additions & 0 deletions New_APIs/NestJs_API/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
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',
'@typescript-eslint/no-explicit-any': 'off',
},
};
35 changes: 35 additions & 0 deletions New_APIs/NestJs_API/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# compiled output
/dist
/node_modules

# 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 New_APIs/NestJs_API/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
124 changes: 124 additions & 0 deletions New_APIs/NestJs_API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<a name="readme-top"></a>

<br />
<div align="center">
<a href="https://github.com/Puskar-Roy/NestJs_API.git">
<img src="https://miro.medium.com/v2/resize:fit:1400/1*-hmwuf8jE2c7fPdMzX9_0w.jpeg" alt="Logo" width="200" height="100">
</a>

<h3 align="center">NEST Js + Type ORM + Postgre SQL +Json Web Tokens</h3>

<p align="center">
This REST API features CRUD routes for users, along with registration, login functionalities, and route protection. πŸš€πŸ”
<br />
<br />
<br />
<a href="https://github.com/Puskar-Roy/NestJs_API/issues">Report Bug</a>
Β·
<a href="https://github.com/Puskar-Roy/NestJs_API/issues">Request Feature</a>
</p>
</div>


## Getting Started πŸš€

### Prerequisites
Before you begin contributing to this project, make sure you have the following set up:

- [Node.js](https://nodejs.org/): A JavaScript runtime.
- [npm](https://www.npmjs.com/): The Node.js package manager.

### Run This ⌨️

1. **Clone the Repository:**
```bash
git clone https://github.com/Puskar-Roy/NestJs_API.git
```
2. **Install Dependencies:**
```bash
npm install
```
3. **Run This Project:**
```bash
npm run dev
```
or

```bash
npm start
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>
## API End Points 🌟
1. **Home Route** πŸš€
```bash
GET - http://localhost:3000/
```
2. **Register User Route** πŸ“₯
```bash
POST - http://localhost:3000/api/auth/register
```
Request Body For Register Route -
```bash
{
"name":"etc1",
"email": "etc1@gmail.com",
"phoneNumber":"+917449585365",
"password":"etc@1234",
"password":"etc@1234",
}
```
3. **Login User Route** ⚑
```bash
POST - http://localhost:3000/api/auth/login
```
Request Body For Login Route -
```bash
{
"email": "etc1@gmail.com",
"password":"etc@1234",
}
```
4. **Get All User Route** ⌨️
```bash
GET - http://localhost:3000/api/user/allUsers
```
5. **Get a Single User Route** πŸ‘¦
```bash
GET - http://localhost:3000/api/user/:userId
```
6. **Update User Route** ⚑
```bash
PATCH - http://localhost:3000/api/user/:userId
```
Request Body For Update User Route -
```bash
{
"name":"etc2",
"email": "etc2@gmail.com",
"phoneNumber":"+917449585365",
}
```
7. **Delete User Route** πŸš€
```bash
DELETE - http://localhost:3000/api/user/:userId
```


<p align="right">(<a href="#readme-top">back to top</a>)</p>



### Future Works 🟩
1. **Add .env Package**🌟
2. **Add cors , rate limiter , helmet , xss , hpp etc Packages**🌟
3. **Deployment**🌟


### Puskar Roy πŸ–‹οΈ






8 changes: 8 additions & 0 deletions New_APIs/NestJs_API/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
Loading