Skip to content

NSBMFinalProjects/DEA-Ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

339 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perfect — let’s polish it with badges like a professional open‑source project.

Here’s your final styled README.md with badges:


# 🛒 DEA E-Commerce Platform

![Node.js](https://img.shields.io/badge/Node.js-18+-green?logo=node.js)
![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14+-blue?logo=postgresql)
![Express](https://img.shields.io/badge/Express.js-Backend-lightgrey?logo=express)
![React](https://img.shields.io/badge/React-Frontend-61DAFB?logo=react)
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

A secure, full-featured **e-commerce platform** built with **Node.js, Express, React, and PostgreSQL**, offering product management, role-based dashboards, secure checkout, and order tracking for customers, suppliers, and administrators.

---

## 🚀 Features

- **User Authentication & Roles**: JWT-based authentication for **Customer**, **Supplier**, and **Admin** roles  
- **Product Management**: Add, edit, delete products with categories & images  
- **Dynamic Shopping Cart**: Real-time updates and smooth checkout flow  
- **Order Management**: Track, view, and manage orders efficiently  
- **Payment Integration**: Supports secure online payments (gateway-ready)  
- **Supplier Dashboard**: Manage stock, view sales analytics  
- **Admin Panel**: Oversee users, products, and transactions  
- **Responsive Design**: Works on desktop, tablet, and mobile  

---

## 🔐 Security Features

- **JWT Authentication**  
  - Token-based login with expiration  
  - Refresh token support for extended sessions  

- **Role-Based Access Control**  
  - Separate permissions for Admin, Supplier, and Customer  

- **Secure Password Storage**  
  - Hashing and salting following industry standards  

- **CORS Protection**  
  - Safe API access for front-end integrations  

---

## 🛠️ Installation

### Prerequisites
- Node.js **18+**  
- PostgreSQL **14+**  
- Git  

### Setup
1. **Clone the repository**  
   ```bash
   git clone https://github.com/NSBMFinalProjects/DEA-Ecommerce.git
   cd DEA-Ecommerce
  1. Install dependencies

    npm install
  2. Configure environment variables Create a .env file:

    DB_HOST=your_db_host
    DB_USER=your_db_user
    DB_PASSWORD=your_db_password
    DB_NAME=dea_ecommerce
    JWT_SECRET=your_secret_key
  3. Run migrations

    npx sequelize-cli db:migrate
  4. Start the server

    npm run dev

The server will start on http://localhost:3000 (or configured port).


📡 API Endpoints

Authentication

  • POST /api/auth/register – Register a new user
  • POST /api/auth/login – Login & receive token

Products

  • GET /api/products – Fetch all products
  • POST /api/products – Add a new product (Admin/Supplier only)

Orders

  • POST /api/orders – Place an order
  • GET /api/orders/:id – Get order details

(Full API documentation coming soon)


🔧 Usage

Sample Fetch Request (JavaScript)

const token = "your_jwt_token";
fetch("http://localhost:3000/api/products", {
  headers: { "Authorization": `Bearer ${token}` }
})
.then(res => res.json())
.then(data => console.log(data));

🗂 Roadmap

  • Complete Swagger API documentation
  • Add multi-language support
  • Enable advanced analytics for suppliers
  • Integrate multiple payment gateways
  • Implement email & SMS notifications

👥 Contributors

  • Team: NSBM Final Year Project Team

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


📞 Support

For questions and support, please open an issue in the GitHub repository.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10