Skip to content

blessme247/nodejs-ecommerce

Repository files navigation

🛒 EvoMart

A full-stack e-commerce platform with user authentication, shopping cart, payment processing, and seller management.

Node.js MongoDB Express

Features

  • 🛍️ Product browsing with search and filters
  • 🛒 Shopping cart (guest & authenticated users)
  • 💳 Paystack payment integration
  • 👤 Session authentication with role-based access
  • 📦 Order management
  • 🖼️ Cloudinary image upload
  • 🔒 CSRF protection & secure sessions

Tech Stack

Backend: Node.js, Express, MongoDB, Mongoose
Frontend: EJS, CSS, Vanilla JavaScript
Security: JWT, bcrypt, csrf-sync, Helmet
Payments: Paystack
Storage: Cloudinary

Quick Start

# Clone repository
git clone https://github.com/blessme247/nodejs-ecommerce.git
cd nodejs-ecommerce

# Install dependencies
npm install

# Configure environment variables (see .env.example)
cp .env.example .env


# Start server
npm run dev

Visit http://localhost:3500

Project Structure

├── controllers/      # Business logic
├── models/          # Mongoose schemas
├── routes/          # API routes
├── middleware/      # Auth, CSRF, etc.
├── views/           # EJS templates
├── public/          # Static files
└── config/          # Configuration files

Key API Endpoints

POST   /api/auth/register      # User registration
POST   /api/auth/login         # User login
GET    /api/products           # Get products
POST   /api/cart/add           # Add to cart
POST   /api/payment/verify     # Verify payment

Security Features

  • Session authentication with httpOnly cookies
  • CSRF protection on all state-changing operations
  • Password hashing with bcrypt
  • Role-based access control (Buyer/Seller)
  • MongoDB session store with TTL
  • Helmet.js security headers

License

MIT

About

Nodejs E-Commerce app with Session Auth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors