Scatch is a full stack ecommerce web application built using Node.js, Express.js, MongoDB, EJS, and Tailwind CSS.
The project includes:
- User Authentication
- Product Management
- Shopping Cart Functionality
- Quantity Management
- Dynamic Cart Pricing
- Admin Product Creation
- Flash Messages
- JWT Authentication
- Environment Based Route Protection
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT Authentication
- bcrypt
- express-session
- connect-flash
- EJS
- Tailwind CSS
- Remix Icons
- Register User
- Login User
- Logout User
- JWT Token Based Authentication
- Protected Routes using Middleware
- Create Products
- Store Product Images
- Dynamic Product Rendering
- Product Discount Support
- Add to Cart
- Increase Quantity
- Decrease Quantity
- Remove Product when Quantity becomes 0
- Dynamic Total Price Calculation
- Discount Handling
- Responsive Navbar
- Conditional Navbar Rendering
- Cart Summary
- Account Page
- Flash Success/Error Messages
Scratch/
│
├── config/
├── middlewares/
├── models/
├── public/
├── routes/
├── views/
│ ├── partials/
│ ├── account.ejs
│ ├── cart.ejs
│ ├── shop.ejs
│ └── index.ejs
│
├── .env
├── app.js
├── package.json
└── README.mdgit clone https://github.com/Raj2006git/Scatch.gitcd scratchnpm install express ejs bcrypt mongoose jsonwebtoken dotenv config multer tailwind debug cookie-parser connect-flash express-sessionCreate a .env file in the root directory.
Example:
NODE_ENV=development
JWT_KEY=your_jwt_secret
MONGODB_URI=your_mongodb_connection_stringnpm startor
nodemon app.jsThe owner creation route is protected using:
if(process.env.NODE_ENV === "development")This ensures admin creation routes are unavailable in production.
cart: [
{
product: ObjectId,
quantity: Number
}
]- Razorpay / Stripe Integration
- Wishlist
- Order Tracking
- Product Search
- Product Filters
- Admin Dashboard
- Inventory Management
- Responsive Mobile UI
This project helped in understanding:
- REST APIs
- MVC Architecture
- Authentication
- MongoDB Relationships
- Mongoose Populate
- Dynamic EJS Rendering
- Environment Variables
- Git & GitHub Workflow
Raj Mohanty
This project is for learning and educational purposes.