Skip to content

Commit

Permalink
added prettier config,api-rate-limit, updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
nil2022 committed Jan 12, 2024
1 parent 6e04cc8 commit 87726ab
Show file tree
Hide file tree
Showing 17 changed files with 594 additions and 483 deletions.
16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.env
.env
.env.*

node_modules
node_modules/**

./dist
dist

./coverage
coverage

./test
test

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": false,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"endOfLine": "crlf"
}
77 changes: 51 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,79 @@
</a>
</p>

**v1.0.2**
**v1.0.3**

This app is build using Backend Development tools like
> **bcrypt, body-parser, dotenv, express, jsonwebtoken, mongoose, node-rest-client, path, moment-timezone**
The Social App is built using the following backend development tools:

### API's available:-
- bcrypt
- body-parser
- dotenv
- express
- jsonwebtoken
- mongoose
- node-rest-client
- path
- moment-timezone
- prettier
- helmet
- express-rate-limit

NOTE:-
**1️⃣** Use {your_URL} or {localhost}
**2️⃣** Request Format - (Method) (Type) (URL)
## APIs Available

1. **[POST]** - Signup - http://{URL}/api/v1/auth/signup
2. **[POST]** - Signin - http://{URL}/api/v1/auth/signin
3. **[POST]** - Add one Post/many Posts (one Post at a time) - http://{URL}/api/v1/addPost
4. **[GET]** - Fetch all Posts specifying user - http://{URL}/api/v1/posts
5. **[DELETE]** - Delete one Post specifying Post Id - http://{URL}/api/v1/posts
6. **[DELETE]** - Delete All Post specifying userId - http://{URL}/api/v1/allposts
The Social App provides the following APIs:

1. **[POST]** - Signup - `http://{URL}/api/v1/auth/signup`
2. **[POST]** - Signin - `http://{URL}/api/v1/auth/signin`
3. **[POST]** - Add one Post/many Posts (one Post at a time) - `http://{URL}/api/v1/addPost`
4. **[GET]** - Fetch all Posts specifying user - `http://{URL}/api/v1/posts`
5. **[DELETE]** - Delete one Post specifying Post Id - `http://{URL}/api/v1/posts`
6. **[DELETE]** - Delete All Post specifying userId - `http://{URL}/api/v1/allposts`

Note: Replace `{URL}` with your actual URL.

### Installation:-

- Run this command to install dependencies

### ```npm install```
### `npm install`

**NOTE:** If above command doesn't install all dependencies, run below command

**NOTE:** If above command doesn't install all dependencies, run below command
### ```npm run build```
### `npm run build`

- Start the server by running this command
### ```npm run start```
- To check if all is working good! 🎉 - http://{URL}:{PORT}
- **N.B.** - **PORT** can be defined in **".env"** file, otherwise it will default to **3001**
### `npm run start`
- To check if all is working good! 🎉 - http://{URL}:{SERVER_PORT}
- **N.B.** - **SERVER_PORT** can be defined in **".env"** file, otherwise it will default to **3001**

<img align=center src="./assets/home_page.jpg" width="90%" height="100%"><br>

<!-- [![](./assets/Home_page.png)](https://locize.com/blog/next-i18next/) -->

### Note to Developers:-

- I have added my MongoDB database URL to my Environment Variable **(.env)** file and all other secrets, so I insist to create a **(.env)** file and add necessary configuration data which is needed to be hidden from end-user/other developers.

- All the API's mentioned above will work best in Postman (Preferred, becoz I use it!) for testing and development, but other apps may also be used.

### Update
***30-05-2023***

**_30-05-2023_**

- Testing Backend API's and other features to optimise it. Need a Front-end part to be build.

***01-06-2023***
- Added some functionalities.
**_01-06-2023_**

- Added some functionalities.

**_27-09-2023_**

- Added some functionalities.
- Updated README

**_12-01-2024_**

***27-09-2023***
- Added some functionalities.
- Updated README
- Added helmet for secured headers
- Added api rate limit for security
- Added CodeQl, Node.js Vulnerability Check for security
- Implemented Prettier for uniform code formatting and readability throughout the project
Binary file modified assets/home_page.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions configs/server.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('dotenv').config()
require("dotenv").config();

module.exports = {
PORT : process.env.PORT || 3001,
SECRET : process.env.SECRET_KEY
}
SERVER_PORT: process.env.SERVER_PORT || 3001,
JWT_SECRET_KEY: process.env.JWT_SECRET_KEY,
};
Loading

0 comments on commit 87726ab

Please sign in to comment.