Post

Modern e-Commerce Web Platform

An online marketplace where users can register, browse products, add items to their cart, and complete purchases. Admins can manage products, orders, and users. OAuth (Google) login support and secure authentication with JWT and cookies. Built using Express.js and later refactored to NestJS for maintainability and scalability.

Modern e-Commerce Web Platform

Overview

Building an e-Commerce Web Application using the following technologies:

  • Express JS + Express Generator
  • Mongoose + Population
  • REST API
  • JWT, Cookies
  • Handlebars
  • CORS
  • OAuth + User Authentication
  • NestJS
  • Backend as a Service (BaaS) (e.g., Firebase, Supabase)

e-Commerce Web App - Development Plan (12 Episodes)

EpisodeTitleDescriptionTech Focus
1Project Initialization & SetupScaffold project using Express Generator, set up basic structure and CORS.Express JS, Express Generator, CORS
2Product Model & MongoDB SetupDefine Product schema, connect MongoDB, and build REST APIs for products.Mongoose, REST API
3User Auth: Register, Login & JWTCreate user auth with hashed passwords, JWT, cookies, and middleware.JWT, Cookies, Bcrypt
4Shopping Cart SystemBuild user cart with product population, add/remove functionality.Mongoose Population, Auth
5Order Model & Checkout FlowCheckout process, order schema, update product stock, list user orders.Mongoose, REST API
6Admin Panel & AuthorizationRole-based access, product and order management by admin users.Role-Based Auth, Middleware
7Views with HandlebarsBuild UI with server-side rendering using Handlebars templates.Handlebars, Express
8OAuth Integration (Google Login)Login with Google using Passport, sync with user auth system.OAuth 2.0, Passport.js
9Secure Auth with JWT + CookiesHarden auth security, enable HTTP-only cookies, add CSRF protection.Secure Cookies, JWT
10BaaS Integration (e.g., Firebase)Use Firebase/Supabase for image uploads, analytics, or hosting.Firebase/Supabase
11Migration to NestJSRefactor app to NestJS for modular structure, scalability, maintainability.NestJS, Dependency Injection
12Deployment & Final PolishDeploy app, configure env variables, optimize performance & security.Deployment, Security, Hosting

Technologies & Libraries Used

CategoryTechnology / LibraryDescription
Server FrameworkExpress.jsLightweight web framework for Node.js
 Express GeneratorCLI tool to scaffold Express projects
 NestJSModular, scalable Node.js framework for enterprise apps
DatabaseMongoDBNoSQL document database
 MongooseODM for MongoDB in Node.js
 Mongoose PopulationMethod to auto-populate related documents (e.g., cart products)
AuthenticationJWT (jsonwebtoken)JSON Web Token for user sessions
 cookie-parserParse and manage cookies on the server
 bcryptPassword hashing for secure storage
 passport.jsMiddleware for OAuth strategies
 passport-google-oauth20Google OAuth 2.0 strategy for Passport
Frontend (SSR)Handlebars (hbs)Templating engine for Express views
API ArchitectureREST APIStandard API design pattern using HTTP verbs
Security & UtilityCORSEnable Cross-Origin Resource Sharing
 helmetSecure Express apps by setting HTTP headers
 csurfCSRF protection middleware
File & CloudFirebase / SupabaseBaaS for file storage, authentication, analytics
DeploymentRender / Heroku / VercelCloud platforms to deploy backend
 dotenvLoad environment variables from .env file
 PM2 (optional)Process manager for Node.js in production
Testing & DebuggingPostmanAPI testing tool
 nodemonLive-reloading server for development
This post is licensed under CC BY 4.0 by the author.