A full-stack e-commerce platform with user authentication, shopping cart, payment processing, and seller management.
- 🛍️ 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
Backend: Node.js, Express, MongoDB, Mongoose
Frontend: EJS, CSS, Vanilla JavaScript
Security: JWT, bcrypt, csrf-sync, Helmet
Payments: Paystack
Storage: Cloudinary
# 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 devVisit http://localhost:3500
├── controllers/ # Business logic
├── models/ # Mongoose schemas
├── routes/ # API routes
├── middleware/ # Auth, CSRF, etc.
├── views/ # EJS templates
├── public/ # Static files
└── config/ # Configuration files
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
- 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
MIT