{"id":20964483,"url":"https://github.com/bilalmohib/apimysqldevtest","last_synced_at":"2026-04-18T04:02:23.322Z","repository":{"id":89385551,"uuid":"606402689","full_name":"bilalmohib/ApiMySQLDevTest","owner":"bilalmohib","description":"MYSQL Node JS and Express Based API","archived":false,"fork":false,"pushed_at":"2023-02-26T20:25:25.000Z","size":99,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T07:36:14.790Z","etag":null,"topics":["expressjs","heruko","jawsdb","json","mysql","nodejs","quiz"],"latest_commit_sha":null,"homepage":"https://nodemysqlcrud.herokuapp.com/","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/bilalmohib.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}},"created_at":"2023-02-25T11:39:14.000Z","updated_at":"2023-03-07T14:52:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e3d0d1c-9256-4dd5-bafd-c5808583b99b","html_url":"https://github.com/bilalmohib/ApiMySQLDevTest","commit_stats":null,"previous_names":["bilalmohib/apimysqldevtest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bilalmohib/ApiMySQLDevTest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalmohib%2FApiMySQLDevTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalmohib%2FApiMySQLDevTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalmohib%2FApiMySQLDevTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalmohib%2FApiMySQLDevTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bilalmohib","download_url":"https://codeload.github.com/bilalmohib/ApiMySQLDevTest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalmohib%2FApiMySQLDevTest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31955919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["expressjs","heruko","jawsdb","json","mysql","nodejs","quiz"],"created_at":"2024-11-19T02:55:10.914Z","updated_at":"2026-04-18T04:02:23.306Z","avatar_url":"https://github.com/bilalmohib.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"QUIZ API Developer Test\n\n- [Deployed on Heroku](#deployed-on-heroku)\n- [Quiz API](#quiz-api)\n  - [Quiz JSON](#quiz-json)\n  - [Quiz API Endpoints](#quiz-api-endpoints)\n  - [Testing the API](#testing-the-api)\n  - [GET /quiz](#get-quiz)\n  - [POST /quiz](#post-quiz)\n  - [GET /quiz/:id](#get-quizid)\n  - [**PUT /quiz/:id**](#put-quizid)\n  - [**DELETE /quiz/:id**](#delete-quizid)\n  - [**Quiz API Source Code**](#quiz-api-source-code)\n  - [**Quiz API Demo**](#quiz-api-demo)\n\nDeployed on Heroku\n========\n[Quiz API](https://nodemysqlcrud.herokuapp.com/quiz) is deployed on Heroku.\n\nQuiz API\n========\n\nQuiz API is a REST API that stores quiz questions and answers in JSON format.\n\n*   One of the options is the correct answer.\n*   The user will select the correct answer and the app will check if the answer is correct.\n*   The Quiz JSON have a question property and options can be two, three or four options. and one of the options is the correct answer.\n\nQuiz JSON\n---------\n\nQuiz JSON is a JSON object that stores quiz questions and answers.\n\nOne of the options is the correct answer.\n\nThe user will select the correct answer and the app will check if the answer is correct.\n\nThe Quiz JSON have a question property and options can be two, three or four options. and one of the options is the correct answer.\n\nHere is an example of a Quiz JSON object:\n\n     {\n        \"id\": 1,\n        \"title\": \"Exam 1\",\n        \"description\": \"This is the first exam.\",\n        \"rating\": 5,\n        \"isActivated\": true,\n        \"created_at\": \"2020-05-01T00:00:00.000Z\",\n        \"updated_at\": null,\n        \"created_by\": \"admin\",\n        \"quizQuestions\": [\n            {\n            \"id\": 1,\n            \"question\": \"What is the capital of France?\",\n            \"options\": [\n                \"Paris\",\n                \"London\",\n                \"Berlin\",\n                \"Rome\"\n            ],\n            \"answer\": \"Paris\",\n            \"isMandatory\": true\n            },\n            {\n            \"id\": 2,\n            \"question\": \"What is the capital of Germany?\",\n            \"options\": [\n                \"Paris\",\n                \"London\",\n                \"Berlin\",\n                \"Rome\"\n            ],\n            \"answer\": \"Berlin\",\n            \"isMandatory\": true\n            }\n        ]\n    }\n    \n\nQuiz API Endpoints\n------------------\n\nQuiz API has the following endpoints:\n\n*   GET /quiz , \n    URL: [https://nodemysqlcrud.herokuapp.com/quiz](https://nodemysqlcrud.herokuapp.com/quiz)\n*   POST /quiz\n    URL: [https://nodemysqlcrud.herokuapp.com/quiz](https://nodemysqlcrud.herokuapp.com/quiz)\n*   GET /quiz/:id\n    URL: [https://nodemysqlcrud.herokuapp.com/quiz/:id](https://nodemysqlcrud.herokuapp.com/quiz/:id)\n*   PUT /quiz/:id\n    URL: [https://nodemysqlcrud.herokuapp.com/quiz/:id](https://nodemysqlcrud.herokuapp.com/quiz/:id)\n*   DELETE /quiz/:id\n    URL: [https://nodemysqlcrud.herokuapp.com/quiz/:id](https://nodemysqlcrud.herokuapp.com/quiz/:id)\n\nTesting the API\n----------------\nIf you want to test the API endpoints, you can use [Postman](https://www.postman.com/lunar-space-683154/workspace/apitest/collection/26009791-bad2866e-05e2-4bf2-8ee3-ff1554025840?action=share\u0026creator=26009791).\n\nGET /quiz\n---------\n\nGet all quiz questions and answers.\n\nExample:\n\n    GET /quiz\n    \n```json\nResponse:\n[\n    {\n        \"id\": 1,\n        \"title\": \"Biology Quiz\",\n        \"rating\": 3,\n        \"description\": \"Test your knowledge of biology!\",\n        \"quizQuestions\": \"[{\\\"answer\\\": \\\"Cellular respiration\\\", \\\"options\\\": [\\\"Photosynthesis\\\", \\\"Cellular respiration\\\", \\\"Fermentation\\\", \\\"Glycolysis\\\"], \\\"question\\\": \\\"What is the process by which cells convert glucose into ATP?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Ribosome\\\", \\\"options\\\": [\\\"Mitochondria\\\", \\\"Lysosome\\\", \\\"Endoplasmic reticulum\\\", \\\"Ribosome\\\"], \\\"question\\\": \\\"What is the name of the organelle responsible for protein synthesis?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Photosynthesis\\\", \\\"options\\\": [\\\"Photosynthesis\\\", \\\"Cellular respiration\\\", \\\"Fermentation\\\", \\\"Glycolysis\\\"], \\\"question\\\": \\\"What is the name of the process by which plants convert light energy into chemical energy?\\\", \\\"isMandatory\\\": true}]\",\n        \"isActivated\": 1,\n        \"created_at\": \"2023-02-26T15:33:57.000Z\",\n        \"updated_at\": \"2023-02-26T15:33:57.000Z\",\n        \"created_by\": \"admin\"\n    },\n    {\n        \"id\": 2,\n        \"title\": \"Astronomy Quiz\",\n        \"rating\": 4,\n        \"description\": \"Test your knowledge of astronomy!\",\n        \"quizQuestions\": \"[{\\\"answer\\\": \\\"Proxima Centauri\\\", \\\"options\\\": [\\\"Alpha Centauri\\\", \\\"Betelgeuse\\\", \\\"Sirius\\\", \\\"Proxima Centauri\\\"], \\\"question\\\": \\\"What is the closest star to our solar system?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Ganymede\\\", \\\"options\\\": [\\\"Ganymede\\\", \\\"Europa\\\", \\\"Callisto\\\", \\\"Titan\\\"], \\\"question\\\": \\\"What is the name of the largest moon in our solar system?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Canis Major Dwarf\\\", \\\"options\\\": [\\\"Andromeda\\\", \\\"Canis Major Dwarf\\\", \\\"Triangulum\\\", \\\"Large Magellanic Cloud\\\"], \\\"question\\\": \\\"What is the name of the nearest galaxy to our Milky Way?\\\", \\\"isMandatory\\\": true}]\",\n        \"isActivated\": 1,\n        \"created_at\": \"2023-02-26T15:35:32.000Z\",\n        \"updated_at\": \"2023-02-26T15:35:32.000Z\",\n        \"created_by\": \"admin\"\n    },\n    {\n        \"id\": 3,\n        \"title\": \"Programming Quiz\",\n        \"rating\": 5,\n        \"description\": \"Test your knowledge of programming!\",\n        \"quizQuestions\": \"[{\\\"answer\\\": \\\"13\\\", \\\"options\\\": [\\\"25\\\", \\\"13\\\", \\\"17\\\", \\\"None of the above\\\"], \\\"question\\\": \\\"What is the output of the following code: print(3 + 2 * 5)\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"def\\\", \\\"options\\\": [\\\"define\\\", \\\"function\\\", \\\"def\\\", \\\"define_function\\\"], \\\"question\\\": \\\"What is the keyword used in Python to define a function?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"To create a new object of a class\\\", \\\"options\\\": [\\\"To create a new object of a class\\\", \\\"To define an instance method of a class\\\", \\\"To provide a way to access private variables\\\", \\\"To implement inheritance\\\"], \\\"question\\\": \\\"What is the purpose of a constructor in object-oriented programming?\\\", \\\"isMandatory\\\": true}]\",\n        \"isActivated\": 1,\n        \"created_at\": \"2023-02-26T15:37:02.000Z\",\n        \"updated_at\": \"2023-02-26T15:37:02.000Z\",\n        \"created_by\": \"admin\"\n    },\n    {\n        \"id\": 4,\n        \"title\": \"Random Knowledge Quiz\",\n        \"rating\": 5,\n        \"description\": \"Test your general knowledge with these difficult questions!\",\n        \"quizQuestions\": \"[{\\\"answer\\\": \\\"Skin\\\", \\\"options\\\": [\\\"Heart\\\", \\\"Brain\\\", \\\"Skin\\\", \\\"Liver\\\"], \\\"question\\\": \\\"What is the largest organ in the human body?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Vatican City\\\", \\\"options\\\": [\\\"Monaco\\\", \\\"Nauru\\\", \\\"Vatican City\\\", \\\"San Marino\\\"], \\\"question\\\": \\\"What is the smallest country in the world by land area?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"O3\\\", \\\"options\\\": [\\\"O\\\", \\\"O2\\\", \\\"O3\\\", \\\"O4\\\"], \\\"question\\\": \\\"What is the chemical formula for ozone?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Mariana Trench\\\", \\\"options\\\": [\\\"Mariana Trench\\\", \\\"Puerto Rico Trench\\\", \\\"Java Trench\\\", \\\"Kermadec Trench\\\"], \\\"question\\\": \\\"What is the name of the deepest part of the ocean?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Antarctic\\\", \\\"options\\\": [\\\"Sahara\\\", \\\"Arabian\\\", \\\"Antarctic\\\", \\\"Gobi\\\"], \\\"question\\\": \\\"What is the largest desert in the world?\\\", \\\"isMandatory\\\": true}]\",\n        \"isActivated\": 1,\n        \"created_at\": \"2023-02-26T15:38:31.000Z\",\n        \"updated_at\": \"2023-02-26T15:38:31.000Z\",\n        \"created_by\": \"admin\"\n    }\n]\n```\n    \n\nPOST /quiz\n----------\n\nCreate a new quiz question and answer.\n\nExample:\n\nPOST /quiz\n\n**Body:**\n```JSON\n    {\n    \"title\": \"Random Knowledge Quiz\",\n    \"description\": \"Test your general knowledge with these difficult questions!\",\n    \"rating\": 4,\n    \"quizQuestions\": [\n        {\n            \"question\": \"What is the largest organ in the human body?\",\n            \"options\": [\n                \"Heart\",\n                \"Brain\",\n                \"Skin\",\n                \"Liver\"\n            ],\n            \"answer\": \"Skin\",\n            \"isMandatory\": true\n        },\n        {\n            \"question\": \"What is the smallest country in the world by land area?\",\n            \"options\": [\n                \"Monaco\",\n                \"Nauru\",\n                \"Vatican City\",\n                \"San Marino\"\n            ],\n            \"answer\": \"Vatican City\",\n            \"isMandatory\": true\n        },\n        {\n            \"question\": \"What is the chemical formula for ozone?\",\n            \"options\": [\n                \"O\",\n                \"O2\",\n                \"O3\",\n                \"O4\"\n            ],\n            \"answer\": \"O3\",\n            \"isMandatory\": true\n        },\n        {\n            \"question\": \"What is the name of the deepest part of the ocean?\",\n            \"options\": [\n                \"Mariana Trench\",\n                \"Puerto Rico Trench\",\n                \"Java Trench\",\n                \"Kermadec Trench\"\n            ],\n            \"answer\": \"Mariana Trench\",\n            \"isMandatory\": true\n        },\n        {\n            \"question\": \"What is the largest desert in the world?\",\n            \"options\": [\n                \"Sahara\",\n                \"Arabian\",\n                \"Antarctic\",\n                \"Gobi\"\n            ],\n            \"answer\": \"Antarctic\",\n            \"isMandatory\": true\n        }\n    ],\n    \"isActivated\": true,\n    \"created_by\": \"admin\"\n}\n```\n\nResponse:\n```JSON\n{\n    \"error\": false,\n    \"message\": \"Quiz added successfully!\",\n    \"data\": 4\n}\n```\n    \n\nGET /quiz/:id\n-------------\n\nGet a quiz question and answer by id.\n\nExample:\n\n**GET /quiz/1**\n\n**URL Params:**\nid = 1\n\n**URL Just for testing:**\n[https://nodemysqlcrud.herokuapp.com/quiz/1](https://nodemysqlcrud.herokuapp.com/quiz/1)\n\n**Response:**\n```JSON\n[\n    {\n        \"id\": 1,\n        \"title\": \"Biology Quiz\",\n        \"rating\": 4,\n        \"description\": \"Test your knowledge of biology!\",\n        \"quizQuestions\": \"[{\\\"answer\\\": \\\"Cellular respiration\\\", \\\"options\\\": [\\\"Photosynthesis\\\", \\\"Cellular respiration\\\", \\\"Fermentation\\\", \\\"Glycolysis\\\"], \\\"question\\\": \\\"What is the process by which cells convert glucose into ATP?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Ribosome\\\", \\\"options\\\": [\\\"Mitochondria\\\", \\\"Lysosome\\\", \\\"Endoplasmic reticulum\\\", \\\"Ribosome\\\"], \\\"question\\\": \\\"What is the name of the organelle responsible for protein synthesis?\\\", \\\"isMandatory\\\": true}, {\\\"answer\\\": \\\"Photosynthesis\\\", \\\"options\\\": [\\\"Photosynthesis\\\", \\\"Cellular respiration\\\", \\\"Fermentation\\\", \\\"Glycolysis\\\"], \\\"question\\\": \\\"What is the name of the process by which plants convert light energy into chemical energy?\\\", \\\"isMandatory\\\": true}]\",\n        \"isActivated\": 1,\n        \"created_at\": \"2023-02-26T15:33:57.000Z\",\n        \"updated_at\": \"2023-02-26T15:33:57.000Z\",\n        \"created_by\": \"admin\"\n    }\n]\n```\n\n**PUT /quiz/:id**\n-------------\n\nUpdate a quiz question and answer by id.\n\nExample:\n\n**URL Just be like this:**\n[https://nodemysqlcrud.herokuapp.com/quiz/3](https://nodemysqlcrud.herokuapp.com/quiz/3)\n\n**Body:**\n```json\n{\n    \"title\": \"Biology Quiz Updated\",\n    \"description\": \"Test your knowledge of biology! Now Updated Will appear\",\n    \"rating\": 4,\n    \"quizQuestions\": [\n        {\n            \"question\": \"What is the process by which cells convert glucose into ATP?\",\n            \"options\": [\n                \"Photosynthesis\",\n                \"Cellular respiration\",\n                \"Fermentation\",\n                \"Glycolysis\"\n            ],\n            \"answer\": \"Cellular respiration\",\n            \"isMandatory\": true\n        },\n        {\n            \"question\": \"What is the name of the organelle responsible for protein synthesis?\",\n            \"options\": [\n                \"Mitochondria\",\n                \"Lysosome\",\n                \"Endoplasmic reticulum\",\n                \"Ribosome\"\n            ],\n            \"answer\": \"Ribosome\",\n            \"isMandatory\": true\n        },\n        {\n            \"question\": \"What is the name of the process by which plants convert light energy into chemical energy?\",\n            \"options\": [\n                \"Photosynthesis\",\n                \"Cellular respiration\",\n                \"Fermentation\",\n                \"Glycolysis\"\n            ],\n            \"answer\": \"Photosynthesis\",\n            \"isMandatory\": false\n        }\n    ],\n    \"isActivated\": true,\n    \"created_by\": \"admin\"\n}\n``` \n\n**Response:**\n```JSON\n{\n    \"error\": false,\n    \"message\": \"Quiz successfully updated\"\n}\n``` \n    \n\n**DELETE /quiz/:id**\n----------------\n\nDelete a quiz question and answer by id.\n\nExample:\n\n**DELETE /quiz/1**\n\n**Parameters:**\n\n  * id: Quiz id\n\n**URL Just like this**\n[https://nodemysqlcrud.herokuapp.com/quiz/3](https://nodemysqlcrud.herokuapp.com/quiz/3)\n\n**Response:**\n```JSON\n  {\n    \"error\": false,\n    \"message\": \"Quiz successfully deleted\"\n  }\n```\n\n**Quiz API Source Code**\n--------------------\n\nQuiz API source code is available on GitHub:\n\n[Github Source Code](https://github.com/Muhammad-Bilal-7896/ApiMySQLDevTest)\n\n**Quiz API Demo**\n-------------\n\nQuiz API demo is available on Heroku:\n\n[Quiz API Demo](https://nodemysqlcrud.herokuapp.com)\n\nQuiz API is developed by Muhammad Bilal\n\nFor any questions, please contact me at [bilalmohib7896@gmail.com](mailto:bilalmohib7896@gmail.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilalmohib%2Fapimysqldevtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbilalmohib%2Fapimysqldevtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilalmohib%2Fapimysqldevtest/lists"}