{"id":16260931,"url":"https://github.com/piyush-linux/crud","last_synced_at":"2026-01-21T18:02:12.206Z","repository":{"id":157592765,"uuid":"383339120","full_name":"Piyush-linux/CRUD","owner":"Piyush-linux","description":"CRUD Node","archived":false,"fork":false,"pushed_at":"2021-07-10T06:47:32.000Z","size":351,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T14:15:10.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/Piyush-linux.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":"2021-07-06T04:29:25.000Z","updated_at":"2021-07-10T06:47:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"e48bcdf4-080c-4087-99f2-411ce6640f17","html_url":"https://github.com/Piyush-linux/CRUD","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"abcd604bd7e750b3412d032d960fdca6c7024cac"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Piyush-linux/CRUD","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Piyush-linux%2FCRUD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Piyush-linux%2FCRUD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Piyush-linux%2FCRUD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Piyush-linux%2FCRUD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Piyush-linux","download_url":"https://codeload.github.com/Piyush-linux/CRUD/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Piyush-linux%2FCRUD/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28638492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T17:36:33.271Z","status":"ssl_error","status_checked_at":"2026-01-21T17:36:30.617Z","response_time":86,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-10T16:21:49.882Z","updated_at":"2026-01-21T18:02:12.191Z","avatar_url":"https://github.com/Piyush-linux.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![R E S O U R C E](https://youtu.be/W1Kttu53qTg)\n\n# Setup\n```sh\n\u003e mkdir PJ\n\u003e cd PJ\n\u003e touch server.js\n\u003e npm init -y\n\u003e npm i express nodemon body-parser mongoose pug dotenv morgan axios\n\u003e packag.jso \u003e\u003e {\"main\": \"server.js\" , \"npm start\":\"node server.js\"}\n```\n\n# Folder Structure\n```sh\n# git ignore\nnode_modules\n.env\n# git push\npackage.json\n/server.js\n/public/ { css , js , img }\n/views/ {index.pug , partial(header.pug , footer.pug) }\n/server\n    /controller\n    /model\n    /database\n    /routes\n    /services\n```\n\n\n### 1. Creating Server\n    - init exp with env.PORT\n\n### 2. Middleware security, client, request, static\n\n### 3. HTML Template \n    - header\n    - add user \u003e form(id, name, email, gender)\n    - All user : table\n        = usr + edit + del\n\n### 4. load routes\n1. routes/router.js\n```sh\n\u003e GET / \n\u003e GET /adduser\n\u003e GET /updateuser\n```\n2. /services/render.js \u003e res.render( function )\n3. /server.js \u003e use router\n\n### 5. db connect\n- server/connect.js \u003e connect(db) with mongoose\n- .env security key : usr:pasw?dbname\n\n### 6 API\n```sh\n# render\n\u003e GET /\n\u003e GET /add_user\n\u003e GET /update_user\n\n# API\n\u003e GET /api/usr\n\u003e POST /api/usr\n\u003e PUT /api/usr/:id\n\u003e DEL /api/usr/:id\n```\n1. crt Rules\n    - /modl/model.js : exp\u003erules\n2. crt CRUD opr\n    - /controller/controller.js : req rules \u003e export.CRUD function\n    - /router/router.js \u003e router.request(path,controller.CRUD)\n    1. create\n        - get req.data\n        - insert data\n    2. read\n        - fetch all data\n    3. update\n        - get req.id\n        - find in db\n        - then update\n    4. delete\n        - get req.id\n        - find in db\n        - then delete\n3. Render\n    - sevices/render.js exp.root \u003e render()\n    - render: fetch through api with axios\n    - all user \u003e PUG iterate with data | update user | create user\n    1. GET /\n        - get data from api\n        - render in loop in pug with usr.id\n    2. POST /add_user\n        - insert data to api\n        - redirect to /\n    3. PUT /api/:id\n        - get qry id\n        - find in api\n        - upt to db\n        - redirect /\n    4. DELETE /api/:id\n        - get qry id\n        - find in db\n        - del to db\n        - redirect /\n5. Deployment\n    - ! Replace local_host with server_host for API call\n    - https://localhost:3000 with https://website.com\"\n    - git push with only bash for extra prevention","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyush-linux%2Fcrud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiyush-linux%2Fcrud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyush-linux%2Fcrud/lists"}