Skip to content

aashahin/Qenuan-RESTful-API-Social-Media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qenuan RESTFUL API - Social Media

Languages (1)

JavaScript
JavaScript

Frameworks (1)

ExpressJS
ExpressJS
v4.18.2

Data (1)

Mongoose
Mongoose
v6.9.1

DevOps (3)

Dotenv
Dotenv
Git
Git
npm
npm

Software as a Service (SaaS) (1)

Cloudinary
Cloudinary

Open source packages (11)

npm (11)

NAME VERSION LAST UPDATED LAST UPDATED BY LICENSE VULNERABILITIES
bcryptjs v2.4.3 03/03/23 Abdelrahman Shaheen MIT N/A
compression v1.7.4 03/06/23 Abdelrahman Shaheen MIT N/A
cors v2.8.5 03/06/23 Abdelrahman Shaheen MIT N/A
express v4.18.2 03/06/23 Abdelrahman Shaheen MIT N/A
express-validator v6.14.3 03/06/23 Abdelrahman Shaheen MIT N/A
helmet v6.0.1 03/06/23 Abdelrahman Shaheen MIT N/A
jsonwebtoken v9.0.0 03/03/23 Abdelrahman Shaheen MIT N/A
morgan v1.10.0 03/03/23 Abdelrahman Shaheen MIT N/A
multer v1.4.5 03/03/23 Abdelrahman Shaheen MIT N/A
nodemailer v6.9.1 03/03/23 Abdelrahman Shaheen MIT N/A
sharp v0.31.3 03/06/23 Abdelrahman Shaheen Apache-2.0 (High)

API FEATURES

  • Authentication & Authorization
  • CRUD operations
  • Users, Posts, Likes, Followers, Hashs, Comments
  • Profile
  • Upload photos for cloudinary
  • improve images
  • Log out if the password is changed
  • Permissions (Admin,vendor,user)
  • Block Users
  • Verify Rest Code on email
  • Forget Password
  • More to explore!

Run Locally

Clone the project

  git clone https://github.com/aashahin/Qenuan-RESTful-API-Social-Media-Node.js.git

Go to the project directory

  cd my-project

Install dependencies

  npm install

Start the server

  npm run dev

Environment Variables

To run this project, you will need to add the following environment variables to your config.env file

Server Settings

PORT=5000

NODE_ENV=development

BASE_URL=https://example.com

Database

MONGO_URL=mongodb://localhost:0000/ecommerces

JWT

SECRET_KEY='as#ewronh$%@65*-'
EXPIRESIN=90d

Email

-Settings

HOST_MAIL="smtp.example.com"
PORT_MAIL=465
SECURE_MAIL=true
USER_MAIL="support@example.com"
PASSWORD_MAIL="password"

-Message

 FROM_MAIL="Shaheen Team <abdelrahman@shaheen.com>"

Cloudinary

CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=

API Authentication

Some endpoints may require authentication for example. To create a create/delete/update, you need to register your API client and obtain an access token.

The endpoints that require authentication expect a bearer token sent in the Authorization header.

Example:

Authorization: Bearer YOUR TOKEN

Register a new API client

POST /api/v1/user/signup

The request body needs to be in JSON format.

Examples

User Login

POST /api/v1/user/login
Parameter Type Description Required
authentication string Your token no
email string Your email yes
password string Your password yes

Info loggged user

GET /api/v1/user/info
Parameter Type Description Required
authentication string Your token yes

Get Profile

GET /api/v1/user/:id
Parameter Type Description Required
authentication string Your token yes

Logo