{"id":26722814,"url":"https://github.com/asadiahmad/online-shop","last_synced_at":"2025-07-24T09:37:40.584Z","repository":{"id":231396739,"uuid":"781674007","full_name":"AsadiAhmad/Online-Shop","owner":"AsadiAhmad","description":"An online shop with user comments with Nodejs And MongoDB","archived":false,"fork":false,"pushed_at":"2024-06-02T17:34:22.000Z","size":21761,"stargazers_count":32,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T06:55:34.814Z","etag":null,"topics":["backend","css","front-end","full-stack","html","javascript","jwt","mongodb","nodejs","online-shop","responsive-design"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AsadiAhmad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-04-03T20:34:04.000Z","updated_at":"2025-04-02T19:50:31.000Z","dependencies_parsed_at":"2024-06-02T19:29:42.800Z","dependency_job_id":null,"html_url":"https://github.com/AsadiAhmad/Online-Shop","commit_stats":null,"previous_names":["asadiahmad/online-shop"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/AsadiAhmad/Online-Shop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsadiAhmad%2FOnline-Shop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsadiAhmad%2FOnline-Shop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsadiAhmad%2FOnline-Shop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsadiAhmad%2FOnline-Shop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AsadiAhmad","download_url":"https://codeload.github.com/AsadiAhmad/Online-Shop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsadiAhmad%2FOnline-Shop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266822344,"owners_count":23989825,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backend","css","front-end","full-stack","html","javascript","jwt","mongodb","nodejs","online-shop","responsive-design"],"created_at":"2025-03-27T20:37:21.341Z","updated_at":"2025-07-24T09:37:38.989Z","avatar_url":"https://github.com/AsadiAhmad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Online-Shop\nAn online shop with user comments\n\n## Tech :hammer_and_wrench: Languages and Tools :\n\u003cdiv\u003e\n  \u003cimg src=\"https://github.com/devicons/devicon/blob/master/icons/html5/html5-original.svg\" title=\"HTML5\" alt=\"HTML\" width=\"40\" height=\"40\"/\u003e\u0026nbsp;\n  \u003cimg src=\"https://github.com/devicons/devicon/blob/master/icons/css3/css3-plain.svg\"  title=\"CSS3\" alt=\"CSS\" width=\"40\" height=\"40\"/\u003e\u0026nbsp;\n  \u003cimg src=\"https://github.com/devicons/devicon/blob/master/icons/javascript/javascript-original.svg\"  title=\"Javascript\" alt=\"JS\" width=\"40\" height=\"40\"/\u003e\u0026nbsp;\n  \u003cimg src=\"https://github.com/devicons/devicon/blob/master/icons/jquery/jquery-original-wordmark.svg\"  title=\"JQuery\" alt=\"JQuery\" width=\"40\" height=\"40\"/\u003e\u0026nbsp;\n  \u003cimg src=\"https://github.com/devicons/devicon/blob/master/icons/nodejs/nodejs-original-wordmark.svg\" title=\"Nodejs\" alt=\"nodejs\" width=\"40\" height=\"40\"/\u003e\u0026nbsp;\n  \u003cimg src=\"https://github.com/devicons/devicon/blob/master/icons/mongodb/mongodb-original.svg\" title=\"MongoDB\" alt=\"MongoDB\" width=\"40\" height=\"40\"/\u003e\u0026nbsp;\n\u003c/div\u003e\n\n## Tutorial\n\n### Step1 : Install Nodejs\nOnline Shop uses Nodejs as Backend Language\n\nDownload and install Nodejs with this link :\n```sh\nhttps://nodejs.org/en/download\n```\n\n### Step2 : Install MongoDB\nOnline Shop uses MongoDB so install MongoDB\n```sh\nhttps://www.mongodb.com/docs/manual/installation/\n```\n\n### Step3 : Clone GitHub Repo\nGoto your IDE (I usually use Vscode and Webstorm) and clone the src\n```sh\nhttps://github.com/AsadiAhmad/Online-Shop.git\n```\n\n### Step4 : set your Nodejs Application\nthe src does'nt have any Nodejs configuration file\n\ncreate New file named `package.json` in root of src with this lines :\n```sh\n{\n  \"name\": \"untitled\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" \u0026\u0026 exit 1\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"ejs\": \"^3.1.9\",\n    \"express\": \"^4.19.2\",\n    \"jquery\": \"^3.7.1\",\n    \"jsonwebtoken\": \"^9.0.2\",\n    \"mongodb\": \"^6.5.0\",\n    \"mongoose\": \"^8.3.0\",\n    \"multer\": \"^1.4.5-lts.1\",\n    \"path\": \"^0.12.7\"\n  }\n}\n```\nGoto your IDE terminall and type \n```sh\nnpm install\n```\nwith this command nodejs will install package-lock.json and set the configurations\n\n### Step5 : Install necessary Packages\nInstall all of the Packages with npm command\n```sh\nnpm install ejs\n```\n```sh\nnpm install express\n```\n```sh\nnpm install jquery\n```\n```sh\nnpm install jsonwebtoken\n```\n```sh\nnpm install mongodb\n```\n```sh\nnpm install mongoose\n```\n```sh\nnpm install multer\n```\n```sh\nnpm install path\n```\nfor checking installed packages you can run this command :\n```sh\nnpm list\n```\n\n### Step6 : Create Connection to MongoDB\nI have gitignore my connection so you need create new connection file :\n\nCreate a Floder named `Connection` in /root/public/JS/BackEnd path\n\nCreate js file named `connection.js` like this :\n```sh\nconst { MongoClient } = require('mongodb');\nconst uri = 'mongodb+srv://\u003cuser\u003e:\u003cpassword\u003e@cluster-0-130.81jyjqx.mongodb.net/';\nconst dbName = 'OnlineShop';\n\nlet db;\n\nasync function connection() {\n    if (!db) {\n        const client = new MongoClient(uri, { useUnifiedTopology: true });\n        await client.connect();\n        db = client.db(dbName);\n    }\n    return db;\n}\n\nmodule.exports = connection;\n```\n#### Dont forget to replcae your `username` and `password` of your Mongo database here\nif you have another formate of connection string you can replace it into uri\n\n### Step7 : Create MongoDB Datbase and collections :\ncreate datbase named `OnlineShop`\n\ncommands used in MongoDB shell :\n```sh\nuse OnlineShop\n```\nand Create these three collections :\n```sh\nuse OnlineShop\ndb.createCollection(\"Comments\")\ndb.createCollection(\"Products\")\ndb.createCollection(\"users\")\n```\n\n### Step8 : Run the project :\nGoto root path run this:\n```sh\nnpm app.js\n```\n\n## View\n\n\u003cimg src=\"screenShots/Screenshot (796).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (797).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (798).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (799).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (800).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (801).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (802).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (803).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (804).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (833).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (834).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (835).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (836).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (837).png\"/\u003e\n\u003cimg src=\"screenShots/Screenshot (838).png\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasadiahmad%2Fonline-shop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasadiahmad%2Fonline-shop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasadiahmad%2Fonline-shop/lists"}