Skip to content

Commit

Permalink
Merge pull request #130 from Puskar-Roy/newapi
Browse files Browse the repository at this point in the history
[New API] : NEST Js + Type ORM + Postgres SQL +JWT API #114
  • Loading branch information
dishamodi0910 authored May 23, 2024
2 parents 8dca8e0 + ccb5915 commit 1d0a28a
Show file tree
Hide file tree
Showing 31 changed files with 10,801 additions and 0 deletions.
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

0 comments on commit 1d0a28a

Please sign in to comment.