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

added prettier config,api-rate-limit, updated README #25

Merged
merged 1 commit into from
Jan 12, 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
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