{"id":15091645,"url":"https://github.com/milan-sony/e-commerce_application","last_synced_at":"2026-01-04T15:46:52.346Z","repository":{"id":223468673,"uuid":"760405918","full_name":"milan-sony/e-commerce_application","owner":"milan-sony","description":"An E-Commerce Application build with Node.js, Express.js, Handlebars , AJAX and MongoDB","archived":false,"fork":false,"pushed_at":"2024-03-04T15:08:43.000Z","size":254,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T11:16:06.264Z","etag":null,"topics":["ajax","ecommerce-application","ecommerce-platform","ecommerce-website","express","expressjs","handlebars","hbs","jquery","mongodb","mongoose","node-js","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milan-sony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-20T11:08:39.000Z","updated_at":"2024-03-03T16:55:28.000Z","dependencies_parsed_at":"2024-10-14T05:20:31.414Z","dependency_job_id":null,"html_url":"https://github.com/milan-sony/e-commerce_application","commit_stats":{"total_commits":86,"total_committers":1,"mean_commits":86.0,"dds":0.0,"last_synced_commit":"e2ead3c006368d28dcd8b42b64acb50dacef0951"},"previous_names":["milan-sony/e-commerce_application"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milan-sony%2Fe-commerce_application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milan-sony%2Fe-commerce_application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milan-sony%2Fe-commerce_application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milan-sony%2Fe-commerce_application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milan-sony","download_url":"https://codeload.github.com/milan-sony/e-commerce_application/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244952164,"owners_count":20537463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","ecommerce-application","ecommerce-platform","ecommerce-website","express","expressjs","handlebars","hbs","jquery","mongodb","mongoose","node-js","nodejs"],"created_at":"2024-09-25T10:42:21.047Z","updated_at":"2026-01-04T15:46:52.313Z","avatar_url":"https://github.com/milan-sony.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"###### #LearnNodeJS\n\n# E-Commerce Application\n\nAn E-Commerce Application build with Node.js, Express.js, Handlebars , AJAX and MongoDB\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e⏳ Timeline\u003c/b\u003e\u003c/summary\u003e\n\n## Day 1 \n📅 20/01/2024\n\n- index page created\n- layout folder created\n- partial folder created\n- libraries installed\n    - `npm install nodemon` auto restart server\n    - `npm install express-handlebars` for adding layout and partial folder\n        - To set the path of layout and partial folder (inside `app.js`)\n            \n            ```jsx\n            app.engine('hbs', hbs.engine({\n              extname: 'hbs',\n              defaultLayout: 'layout',\n              layoutsDir: __dirname + '/views/layout/',\n              partialsDir: __dirname + '/views/partials'\n            }));\n            ```\n            \n    - `npm install express-fileupload` file upload\n        \n        ```jsx\n        app.use(fileUpload());\n        ```\n        \n- added products to the index page by passing a products object and displayed using `hbs` template\n- create separate page for admin and user\n- admin panel created\n- added products to the admin panel by passing a products object and displayed it in table format\n- added add new product form for admin\n\n## Day 2\n\n📅 21/02/2024\n\n- Mongoose Connected\n    \n    ```jsx\n    const mongoose = require('mongoose');\n    const url = \"mongodb://127.0.0.1:27017/mydb\";\n    \n    module.exports = {\n    \n        connect: () =\u003e {\n            mongoose.connect(url)\n            .then(() =\u003e {\n                console.log(\"Connected to MongoDB\\n\");\n            }).catch((error) =\u003e {\n                console.log(error);\n            });\n        },\n    \n        collection: (name) =\u003e {\n            return mongoose.connection.db.collection(name);\n        }\n    \n    };\n    ```\n    \n    This code exports an object with two methods, **`connect`** and **`collection`**, using Node.js CommonJS module system. Let's break down each part:\n    \n    1. **Importing Mongoose**:\n        \n        ```jsx\n        const mongoose = require('mongoose');\n        ```\n        \n        This line imports the Mongoose library, which allows interaction with MongoDB databases using an object modeling approach.\n        \n    2. **Defining MongoDB URL**\n        \n        ```jsx\n        const url = \"mongodb://127.0.0.1:27017/mydb\";\n        ```\n        \n        This line defines the URL used to connect to the MongoDB database. It specifies the protocol (**`mongodb://`**), the host (**`127.0.0.1`** or **`localhost`**), the port (**`27017`**), and the name of the database (**`mydb`**).\n        \n    3. **Exporting Module**:\n        \n        ```jsx\n        module.exports = {\n            // methods...\n        };\n        ```\n        \n        This code exports an object containing methods using **`module.exports`**, making these methods accessible to other parts of the application.\n        \n    4. **Connect Method**:\n        \n        ```jsx\n        connect: () =\u003e {\n            mongoose.connect(url)\n            .then(() =\u003e {\n                console.log(\"Connected to MongoDB\\n\");\n            }).catch((error) =\u003e {\n                console.log(error);\n            });\n        },\n        ```\n        \n        This method establishes a connection to the MongoDB database specified by the URL. It uses **`mongoose.connect()`** to connect to MongoDB asynchronously. If the connection is successful, it logs a success message to the console. If there's an error during the connection process, it logs the error.\n        \n    5. **Collection Method**:\n        \n        ```jsx\n        collection: (name) =\u003e {\n            return mongoose.connection.db.collection(name);\n        }\n        ```\n        \n        This method returns a MongoDB collection object based on the provided collection name. It uses **`mongoose.connection.db.collection(name)`** to access the specified collection through the Mongoose connection.\n        \n        Overall, this module provides a way to connect to a MongoDB database and access collections within that database using Mongoose. Other parts of the application can import this module and use its methods to interact with the database.\n        \n- `helper` folder created for products\n- product details added to database\n- product image saved to `product_image` folder in `public` folder\n\n⚠ Error occurred: image is not displayed from `product_image` folder\n\n## Day 3\n\n📅 22/02/2024\n\n- Error fixed image is displayed from the `product_image` folder\n- product data added to user side\n- user login and signup page created\n- user signup data saved to db\n- user login and page redirected\n- user session created\n- user logout\n\n## Day 4\n\n📅 23/02/2024\n\n- user valid or invalid checked\n- cart page created\n- middleware created for checking the user login\n- product deleted from admin side\n\n## Day 5\n\n📅 25/02/2024\n\n- product details displayed on another page for editing\n- product details updated and image changed\n- user signup session created\n- working on add to cart\n\n## Day 7\n\n📅 28/02/2024\n\n- Add to cart count updated with Ajax\n- cart item and quantity displayed\n\n## Day 8\n\n📅 29/02/2024\n\n- cart product quantity increased and decreased\n\n## Day 9\n\n📆 01/03/2024\n\n- Product removed from cart\n- product checkout page created\n\n## Day 10\n\n📆 02/03/2024\n\n- Total price added on `place_order.hbs` page\n- Total price added on `cart.hbs`\n- payment methods created\n- Order collection created and product removed from `cart`\n- product details listed on `orders.hbs`\n- product checkout created\n- Cart error fixed\n- Admin view all users added\n- Admin search product\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e⚙ Run locally\u003c/b\u003e\u003c/summary\u003e\n\nYou will need to install Node.js and MongoDB on you system\n\nHead over to https://nodejs.org/en to download Node.js\n\nHead over to https://www.mongodb.com/try/download/community to download MongoDB community server\n\nMake sure Node and NPM are installed and their PATHs defined\n\nOnce you have downloaded Node.js and MongoDB run the following command (clone this project)\n\n```bash\n  https://github.com/milan-sony/e-commerce_application.git\n```\n\nThen go to the project folder\n\n```bash\n  cd e-commerce_application\n```\n\nInstall the dependencies/ packages needed for this project\n\n```bash\n  npm install\n```\n\nOnce the packages are installed run\n\n```bash\n  npm start\n```\n\nThen head over to a browser and type\n\n```bash\n  localhost:3000\n```\n    \n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilan-sony%2Fe-commerce_application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilan-sony%2Fe-commerce_application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilan-sony%2Fe-commerce_application/lists"}