https://github.com/saddamarbaa/node-express-mongodb-typescript-ecom-social-rest-api
An open-source RESTful API developed using NodeJS, Express, MongoDB and TypeScript that helps you to integrate User Authentication, E-commerce management and Social Media Post Management in your application with Filter, pagination, Sort and Search API
https://github.com/saddamarbaa/node-express-mongodb-typescript-ecom-social-rest-api
cloundinary expressjs jest jwt-authentication mongodb-database nodejs supertest swagger-ui typescript
Last synced: 3 months ago
JSON representation
An open-source RESTful API developed using NodeJS, Express, MongoDB and TypeScript that helps you to integrate User Authentication, E-commerce management and Social Media Post Management in your application with Filter, pagination, Sort and Search API
- Host: GitHub
- URL: https://github.com/saddamarbaa/node-express-mongodb-typescript-ecom-social-rest-api
- Owner: saddamarbaa
- License: mit
- Created: 2021-03-29T12:31:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-02T08:35:24.000Z (about 2 years ago)
- Last Synced: 2025-01-29T09:44:55.554Z (4 months ago)
- Topics: cloundinary, expressjs, jest, jwt-authentication, mongodb-database, nodejs, supertest, swagger-ui, typescript
- Language: TypeScript
- Homepage:
- Size: 20.3 MB
- Stars: 52
- Watchers: 3
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Saddam-rest-api
Free Open source REST API built with | Nodejs + Express + Mongodb ⚡️ Made with developer experience first Prettier + VSCode setup.
> - C.R.U.D, Filter, Paginate, Sort and Search API
# Table of contents
- [Author](#Author)
- [Demo](#Demo)
- [Technologies](#Technologies)
- [Contributing](#Contributing)
- [Status](#status)
- [Features](#Features)
- [Related Projects](#Related_Projects)
- [Support](#Support)
- [Feedback](#Feedback)
- [Run Locally](#Run_Locally)
- [API Reference](#API_Reference)
- [Screenshots](#Screenshots)
- [Environment Variables](#Environment)
- [Deployment](#Deployment)# Author
### @Saddam Arbaa
# Technologies
- Node.js
- Express
- MongoDB
- JSON Web Token (JWT)
- bcryptjs
- Heroku Hosting# Demo
### LIVE API Demo
### Front-End REPO
#### Testing Email: [email protected]
#### Testing Password: 12345test
# Features
##### (Users)
- Complete user authentication
- Users can sign in
- Users can sign out
- Users can verify email
- Users can Change Password
- View all products
- View products detail
- Filter products by category
- Search for products
- Add products to their basket
- Checkout total payment
- Checkout order page
- Products pagination##### (Admin)
- Complete Admin Authorization
- Add products
- Update products
- Delete products
- Limit Products
- Add Users
- Update Users
- Delete Users
- Update User Role# API_Reference
#### Get all products
```http
GET https://saddam-rest-api.herokuapp.com/api/v1/products
```| Parameter | Type | Description |
| :--------- | :------- | :-------------------- |
| `limit` | `number` | default= 100 |
| `category` | `string` | default= All Products |
| `page` | `number` | default= 1 |
| `search` | `string` | search string |
| `sortBy` | `string` | default= createdAt |
| `OrderBy` | `string` | default= desc |#### example (Paginate - Sort - Filter - Full-text search
```http
GET https://saddam-rest-api.herokuapp.com/api/v1/products?page=1&limit=99&sortBy=createdAt&OrderBy=desc&filterBy=category&category=Sports
GET https://saddam-rest-api.herokuapp.com/api/v1/products?page=2&limit=99&sortBy=createdAt&OrderBy=desc&filterBy=category&category=Jewelery
GET https://saddam-rest-api.herokuapp.com/api/v1/products?page=2&limit=99&sortBy=createdAt&OrderBy=desc&filterBy=category&category=Books&search=nodejs
```#### Get single product
```http
GET https://saddam-rest-api.herokuapp.com/api/v1/products/${id}
```| Parameter | Type | Description |
| :-------- | :------- | :----------------------------------- |
| `id` | `string` | **Required**. Id of product to fetch |#### Add new product (Only admins)
```http
POST https://saddam-rest-api.herokuapp.com/api/v1/admin/products
```| Parameter | Type | Description |
| :------------- | :------- | :---------------------------------------------------- |
| `name` | `string` | **Required**. product name |
| `price` | `number` | **Required**. product price |
| `description` | `string` | **Required**. product description |
| `productImage` | `img` | **Required**. product Image |
| `category` | `string` | **Required**. product category |
| `count` | `number` | **Optional**. default value = 1 |
| `stock ` | `string` | **Optional**. default value = 'in stock - order soon' |#### Update product (Only admins)
```http
PATCH https://saddam-rest-api.herokuapp.com/api/v1/admin/products/${id}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------------- |
| `id` | `string` | **Required**. Id of product to update |
| `token` | `string` | **Required**. JWT token pass in headers |#### Delete product (Only admins)
```http
DELETE https://saddam-rest-api.herokuapp.com/api/v1/admin/products/${id}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------------- |
| `id` | `string` | **Required**. Id of product to delete |
| `token` | `string` | **Required**. JWT token pass in headers |#### User signup
```http
POST https://saddam-rest-api.herokuapp.com/api/v1/auth/signup
```| Parameter | Type | Description |
| :---------------- | :-------- | :------------ |
| `firstName` | `string` | **Required**. |
| `lastName` | `string` | **Required**. |
| `familyName` | `string` | **Optional**. |
| `email` | `string` | **Required**. |
| `password` | `string` | **Required**. |
| `confirmPassword` | `string` | **Required**. |
| `gender` | `string` | **Optional**. |
| `dateOfBirth` | `string` | **Optional**. |
| `acceptTerms` | `boolean` | **Required**. |
| `mobileNumber` | `number` | **Optional**. |
| `nationality` | `string` | **Optional**. |
| `favoriteAnimal` | `string` | **Optional**. |
| `address` | `string` | **Optional**. |
| `bio` | `string` | **Optional**. |
| `jobTitle` | `string` | **Optional**. |```http
After signup you will receive email to verify your account
```#### User Login
```http
POST https://saddam-rest-api.herokuapp.com/api/v1/auth/login
```| Parameter | Type | Description |
| :--------- | :------- | :------------ |
| `email` | `string` | **Required**. |
| `password` | `string` | **Required**. |#### User Verify Email
```http
POST https://saddam-rest-api.herokuapp.com/api/v1/auth/verify-email`,
```| Parameter | Type | Description |
| :-------- | :------- | :------------ |
| `userId` | `string` | **Required**. |
| `token` | `string` | **Required**. |# Environment
- To run this project, you will need to add the following environment variables to your .env file (check environment.config.js file for more examples)
- MONGODB_CONNECTION_STRING
- TOKEN_SECRET
- WEBSITE_URL
- API_VERSION ="v1"
- JWT_EXPIRE_TIME
- SEND_GRID_API_KEY
- ADMIN_SEND_GRID_EMAIL
- ADMIN_ROLE
- ADMIN_EMAIL
- NODE_ENV = 'development'
- CLIENT_URL
- ACCESS_TOKEN_SECRET_KEY
- REFRESH_TOKEN_SECRET_KEY
- ACCESS_TOKEN_KEY_EXPIRE_TIME
- REFRESH_TOKEN_KEY_EXPIRE_TIME# Contributing
Contributions are always welcome!
# Deployment
To deploy this project on Heroku Flow the Flowing documentation Deploying Node.js Apps on Heroku
# Related_Projects
### Blog API built with | Nodejs + Express + Mongodb
#### LIVE API
#### API REPO
#### Front-End REPO
#### LIVE Webside DEMO
### Twitter API built with | Nodejs + Express + Mongodb
#### LIVE API Demo
#### API REPO
#### Front-End REPO
#### LIVE Webside DEMO
### Netflix API built with | Nodejs + Express + Mongodb
#### API REPO
#### LIVE API Demo
# Support
For support, email [email protected].
# Feedback
If you have any feedback, please reach out to me at [email protected]
https://twitter.com/ArbaaSaddam/Linkedin.
https://www.linkedin.com/in/saddamarbaa/Github
https://github.com/saddamarbaa
https://www.instagram.com/saddam.dev/
https://www.facebook.com/saddam.arbaa# Run_Locally
Clone the project
```bash
https://github.com/saddamarbaa/node-express-rest-api
```Go to the project directory
```bash
cd node-express-rest-api
```Install dependencies
```bash
yarn install
# or
npm install
```Start the server
```bash
node app.js
or
nodemon app.js
```# Status
Project is: in progress I'm working on it in my free time
# Screenshots
## Signup Page


## LogIn Page


## Forgot Password Page



## Reset Password email Link

## Reset Password Page


## Update Profile Page

## Home Page

## Home Page (Filter by category(Bookks))

## Home Page (Filter by category(Sports))

## Home Page (Filter by category(Toys))

## Home Page (Filter by category(Men's clothing))

## Home Page (Search Product (Jewelery))

## Product Detail Page

## Shopping Cart Page

## Orders Page

## Admin Products Page

## Admin Users Page

## Admin Users Table Page

## Admin Add Product Page


## Admin Update Product Page

## Admin Add User Page


## Admin Update User Page
