Skip to content
Az1zbekxPublic

About

Full-featured e-commerce RESTful API engine built with Node.js, Express, and MongoDB with order lifecycle and catalog management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛍️ Tech House: Electronics E-Commerce & Inventory Management Platform

CI License: MIT

Node.js Express.js MongoDB License: MIT

A modular full-stack e-commerce architecture designed for electronics retail, featuring a RESTful API backend, JWT authentication, cart session persistence, and an administrative product management dashboard.


🏗️ System Architecture

graph TD
    Client[Web Client & Admin Dashboard] --> Router[Express Router]
    Router --> Auth[Auth Middleware & JWT]
    Router --> ProductAPI[/api/products - CRUD/]
    Router --> CartAPI[/api/cart - Cart Management/]
    Auth --> MongoDB[(MongoDB Atlas / Local)]
    ProductAPI --> MongoDB
    CartAPI --> MongoDB
Loading

🌟 Key Features

  • JWT Authentication & Authorization: Secure registration, token-based session management, and role validation via bcrypt password hashing.
  • Product Lifecycle Management (CRUD): REST endpoints for listing, filtering, adding, updating, and removing electronics inventory.
  • Shopping Cart Orchestration: Cart persistence with dynamic subtotal calculations.
  • Admin Dashboard: Standalone client interface (frontend/admin/) for real-time inventory adjustments and catalog audits.
  • ES Modules (ESM): Modern native import/export syntax in Node.js 18+.

📡 REST API Reference

🔐 Authentication (/api/auth)

Method Endpoint Description Auth Required
POST /api/auth/register Register a new user ❌ No
POST /api/auth/login Authenticate and obtain JWT token ❌ No

📦 Products Catalog (/api/products)

Method Endpoint Description Auth Required
GET /api/products Retrieve all products (with filters) ❌ No
GET /api/products/:id Get details for a single product ❌ No
POST /api/products Create a new product entry ✅ Yes (Admin)
PUT /api/products/:id Update product details / pricing ✅ Yes (Admin)
DELETE /api/products/:id Delete a product from inventory ✅ Yes (Admin)

🛒 Shopping Cart (/api/cart)

Method Endpoint Description Auth Required
GET /api/cart View user cart items & total ✅ Yes
POST /api/cart Add product to cart ✅ Yes
DELETE /api/cart/:id Remove specific item from cart ✅ Yes

📂 Project Structure

TechHouse/
├── backend/
│   ├── package.json
│   └── src/
│       ├── app.js               # Express application configuration
│       ├── server.js            # Server entrypoint and DB connection
│       ├── controllers/         # Business logic (auth, product, cart)
│       ├── routes/              # Route definitions
│       └── data/db.js           # Database connection layer
├── frontend/
│   ├── admin/                   # Administrative product dashboard
│   └── login/                   # Authentication interface
├── .gitignore                   # Ignored files (node_modules, .env)
└── README.md                    # Project documentation

🚀 Quickstart & Installation

1. Clone the Repository

git clone https://github.com/Az1zbekx/TechHouse.git
cd TechHouse

2. Configure Backend Environment

Navigate to backend/ and create .env:

cd backend
cat <<EOF > .env
PORT=5000
MONGODB_URI=mongodb://localhost:27017/techhouse
JWT_SECRET=your_super_secret_jwt_key
EOF

3. Install Dependencies & Start Server

npm install
npm run dev

The backend API will start at http://localhost:5000.

4. Open Frontend

Open frontend/login/index.html or frontend/admin/index.html directly in your browser or serve using VS Code Live Server.


👤 Author

About

Full-featured e-commerce RESTful API engine built with Node.js, Express, and MongoDB with order lifecycle and catalog management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages