Metacart is an E-commerce website with admin panel designed and implemented for single seller using Node.js and MySQL and AWS S3.
Demo on Heroku - https://metacart.herokuapp.com
- View catalogue of products, filter by category and price range, sort by popularity and price and search for specific product by title
- Secure login and registration system with features like Google OAuth sign-in, password reset and account activation
- Content management system for admin to maintain the content, order of webpages and adding dynamic content on the website with rich-text editor
- Adding new products, editing existing products, deleting existing products, auto generating thumbnail images for products and updating order status along with tracking ID
- Adding a new category, editing existing category and deleting existing category
- Users upon purchasing a product will have an option to rate the product and also write a review about the experience
- Users can maintain multiple delivery addresses for easy checkout
- Users can use the cart system where products can be added, removed, increment, decrement, clear entire cart along with providing a detailed view of order subtotal and total pricing
- The cart items are stored in database when the user is logged in else the items are temporarily stored in the session cookie and merged to database when user logs in.
- The products are paginated for quick load time and the user can navigate between the pages
- Paytm payment gateway integration for secure and reliable payments via multiple methods like credit card, debit card, Paytm wallet, Net-banking
- User can cancel the order once the payment has been successful if required.
- User can return the product within a period of 30 days from the moment
when order is
Delivered
. - The admin/seller has a birds-eye view of all the orders divided into sections by their current status so that they can be managed with ease.
- The webpages are responsive and designed using Materialize
- aws-sdk - AWS S3 for media storage
- bcryptjs - Hashing passwords
- body-parser - Body parsing middleware
- chalk - Colorful terminal!
- @sendgrid/mail - Sending mails
- cors - Cross-origin resource sharing
- crypto-random-string - Generating identifiers
- dotenv - Loading ENV vars
- ejs - Templating engine
- express - App framework
- express-fileupload - Uploading files
- express-messages - Flash messages
- express-mysql-session - Sessions store
- express-session - Sessions
- express-validator - Input validation
- jsonwebtoken - JWT
- lodash - JS utilities
- bad-words - Filtering profanity
- moment - Formatting timestamps
- morgan - Development logging
- mysql - MySQL connector
- passport - Authentication middleware
- passport-google-oauth20 - Google OAuth
- passport-local - Local authentication
- resize-img - Generating thumbnails
- shortid - Generating short ids
- uuid - Generating RFC4122 UUIDs
- nodemon - Easy development
- Metacart requires Node.js to run.
- Install the dependencies and devDependencies
$ npm install
- Genetate all required API keys for PayTM, AWS, Google and SendGrid from their consoles
- Acquire MySQL connection credentials and create tables
- Use mkcert to generate self-signed SSL certificate for localhost
- Create
.env
file in/config
with following variables
$ touch .env
Variable | Value | Info |
---|---|---|
CALLBACK_URL | https://localhost:3000/checkout/paytm-response |
Callback URL after PayTM payment |
CHANNEL_ID | WEB |
PayTM integration |
INDUSTRY_TYPE_ID | Retail |
PayTM integration |
MID | PayTM merchant ID | |
PAYTM_FINAL_URL | PayTM URL for payment init | |
PAYTM_MERCHANT_KEY | PayTM merchant key | |
WEBSITE | WEBSTAGING |
PayTM integration |
CLIENT_URL | https://localhost:3000 |
App URL |
DATABASE_HOST | MySQL hostname | |
DATABASE_NAME | MySQL DB name | |
DATABASE_PASSWORD | MySQL password | |
DATABASE_USER | MySQL username | |
EMAIL_FROM | Email address used to send | |
EMAIL_TO | Reply-to mail address | |
EXPRESS_SESSION_SECRET | Secret value | |
GOOGLE_CLIENT_ID | Obtain Client ID from Google console | |
GOOGLE_CLIENT_SECRET | Google client secret from console | |
JWT_ACCOUNT_ACTIVATION | Secret value to sign account activation link | |
JWT_PASSWORD_RESET | Secret value to sign forgot password link | |
NODE_ENV | development or production |
Node environment |
SENDGRID_API_KEY | Twilio Sendgrid API key | |
SESSION_SECRET | Secret value for sessions | |
AWS_ID | AWS integration id | |
AWS_SECRET | AWS secret key | |
AWS_BUCKET_NAME | ecommerce-metacart |
AWS s3 media bucket name |
SSL_CERT | Self signed SSL certificate for localhost | |
SSL_KEY | Self signed SSL key for localhost |
- Start the server
node app
- Verify the deployment
https://localhost:3000
May the source be with you