{"id":26209065,"url":"https://github.com/junaidrahim/kbc-webapp","last_synced_at":"2026-04-29T14:04:24.705Z","repository":{"id":94393169,"uuid":"152213871","full_name":"junaidrahim/KBC-webapp","owner":"junaidrahim","description":"A simple webapp paired with an android app to conduct a group quiz game.","archived":false,"fork":false,"pushed_at":"2019-06-05T05:13:04.000Z","size":16639,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-17T10:04:39.165Z","etag":null,"topics":["flask","python","quiz","quiz-game","rest-api"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/junaidrahim.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":"2018-10-09T08:16:59.000Z","updated_at":"2022-01-08T20:55:39.000Z","dependencies_parsed_at":"2023-04-16T05:35:38.097Z","dependency_job_id":null,"html_url":"https://github.com/junaidrahim/KBC-webapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/junaidrahim/KBC-webapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junaidrahim%2FKBC-webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junaidrahim%2FKBC-webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junaidrahim%2FKBC-webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junaidrahim%2FKBC-webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junaidrahim","download_url":"https://codeload.github.com/junaidrahim/KBC-webapp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junaidrahim%2FKBC-webapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32428622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"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":["flask","python","quiz","quiz-game","rest-api"],"created_at":"2025-03-12T06:34:05.170Z","updated_at":"2026-04-29T14:04:24.698Z","avatar_url":"https://github.com/junaidrahim.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![\"HEADER\"](screenshots/header.png)\n\nIt's a simple **Server + Android App** system which can be used to conduct a quiz game for a relatively\nmoderate amount of users. This enables a group of participants to sit together and play a quiz game on their phones and find out who scored the most. \n\nThis repository contains the code for the server written in **Python3** using the\n**Flask** framework. It just provides a REST API to be used by the app and some web pages that help the host\nconduct the quiz game. \n\n## Motivation \n\nThis project is named after the show \"Kaun Banega Crorepati\" or \"KBC\". I built this because my housing society wanted to conduct a small quiz event for the children on the eve of Children's Day 2018.\n\n\u003cbr\u003e\n\n## How to start the server ?\n\n### Dependencies \n\n1. Python3\n2. Flask\n\n### To install the dependencies:\n \nrun `pip3 install -r requirements.txt`\n\u003e NOTE: use `pip` or `pip3` as specified in your operating system\n\n\n## To start the server:\n1. Add your local ip on the first lines of `static/js/registered.js` and `static/js/submissions.js`\n2. The run `python3 app.py`\n\n\u003e NOTE: Don't forget the first step, else your js won't have a valid ip to make requests to.\n\nAfter this you will be able to view it on `http://\u003cyour ip\u003e:8000/` in your browser.\n\nThe .apk file is available [here](static/KBC-quizapp.apk)\n\nThe code for the app is availabe on : https://github.com/junaidrahim/KBC-Quiz-App\n\n\u003cbr\u003e\n\n## Screenshots : \n\n### Index Page\n![](screenshots/index.png) \u003cbr\u003e\n\n### Registered Users\n![](screenshots/registered.png) \u003cbr\u003e\n\n### Submissions\n![](screenshots/submissions.png) \n\n\n\u003e NOTE: The js won't execute if you do `localhost` due to same origin policy, instead put the ip of your pc/server.\n\n\u003cbr\u003e\u003cbr\u003e\n\n## How does this Work ?\n\nWell, the basics are pretty simple. This repository has the code for the server. You start the server\nand then use an android app that makes appropriate requests to the server and you get to conduct your game.\n\nCheck the players who registered on the page `http://localhost:8000/resgistered`\n\nAnd then you can check/display the submissions on the page `http://localhost:8000/submissions`. The javascript\non this page will fetch the submission data, add up the scores and sort the players, and display them in ranks\naccordingly.\n\n### Directory Structure\n\n```bash\n├── app.py\n├── LICENSE\n├── README.md\n├── requirements.txt\n├── screenshots\n│   ├── header.png\n│   ├── index.png\n│   ├── registered.png\n│   └── submissions.png\n├── static\n│   ├── css\n│   │   ├── index.css\n│   │   ├── registered.css\n│   │   └── submissions.css\n│   ├── js\n│   │   ├── jquery.min.js\n│   │   ├── registered.js\n│   │   └── submissions.js\n│   └── KBC-quizapp.apk\n└── templates\n    ├── index.html\n    ├── questions.html\n    ├── registered.html\n    └── submissions.html\n\n5 directories, 19 files\n```\n\n### Web Pages Available:\n\n1. `http://localhost:8000/`. This is the main **Homepage.**\n2. `http://localhost:8000/resgistered` . This page shows the **Registered users** (updates in real time).\n3. `http://localhost:8000/submissions` . This page shows the **Submissions**. (updates in real time)\n4. `http://localhost:8000/questions` . This page can be used to display the questions to the audience after the quiz is over\n\n\u003e Note: Replace `localhost` with the ip of your computer on the network\n\n\u003cbr\u003e\n\n### API Details:\n\n* **URL** : `/api/post/register`\n\n    * Method : `POST`\n    * Description : Will register the user and send a unique id.\n    * Required Params : `name=[string]`\n    * Sample Request : `{ \"name\" : \"John Doe\" }`\n    * Success Response : `{ \"success\":True, \"id\":\"\u003csome unique id\u003e\", \"error\": \"none\" }`\n    * Error Response : `{ \"success\":False, \"error\": \u003cdetails about the error\u003e }`\n\n* **URL** : `/api/post/delete_registration`\n\n    * Method : `POST`\n    * Description: Will delete the user whose corresponding details were sent.\n    * Required Params : `name=[string], id=[string]`\n    * Sample Request : `{ \"name\" : \"John Doe\", \"id\":\"89jes1s\" }`\n    * Success Response : `{ \"success\":True, \"error\":\"none\" }`\n    * Error Response : `{ \"success\":False, \"error\":\"request to delete a non-existing user\" }`\n\n\n* **URL** : `/api/post/submission`\n\n    * Method : `POST`\n    * Description : Will append the score sent for the corresponding user. Total score will be the sum of the array\n    * Required Params : `name=[string], id=[string], score=[int]`\n    * Sample Request : `{ \"name\" : \"John Doe\", \"id\":\"89jes1s\", \"score\": 4 }`\n    * Success Response : `{ \"success\":True, \"error\":\"none\" }`\n    * Error Response : `{\"success\":False, \"error\": \"User is not registered\"}`\n\n* **URL** : `/api/get/registered_users`\n\n    * Method : `GET`\n    * Description : Will return details of all the registered users in the following json format\n    * Required Params : `none`\n    * Success Response : \n        ```json\n        {\n            \"t1x7l\": \"Elliot Alderson\",\n            \"zwokr\": \"John Doe\"\n        }\n        ```\n\n* **URL** : `/api/get/submissions`\n\n    * Method : `GET`\n    * Description : Will return the submissions of all the users in the following json format.\n    * Required Params : `none`\n    * Success Response : \n        ```json\n        {   \n            \"t1x7l\": [ \"Elliot Alderson\", [3, 4, 0, 0, 0, 5] ],\n            \"zwokr\": [ \"John Doe\", [4, 0, 0, 0, 2, 3] ]\n        }\n        ```\n\n\u003cbr\u003e\n\n## Note to the Reader\n\nThis is a very dead simple project to conduct the game. My userbase was like 20 so I kept it simple 😅. This needs a lot of improvement and security features, it will work fine if you're using this in a closed network for \nlimited amount of people.\n\n## Features to be implemented :\n\nWe will have to add a lot of features to make this system a solid one. Some of them are below, I am always open to new suggestions and PRs. 😁✌️\n\n- [ ] Database Support, probably mongodb\n- [ ] Adding more security to the API\n- [ ] More Sophisticated Authentication\n- [ ] A cap on max amount of score the API accepts.\n\n\n## LICENSE\n\nCopyright(c) **Junaid H Rahim**. All Rights Reserved\n\nLicensed under the [MIT](LICENSE) License.\n\n[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)\n[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)\n[![forthebadge](https://forthebadge.com/images/badges/for-you.svg)](https://forthebadge.com)\n\nHeader Icon made by \u003ca href=\"https://www.flaticon.com/authors/prosymbols\" title=\"Prosymbols\"\u003eProsymbols\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003ewww.flaticon.com\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunaidrahim%2Fkbc-webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunaidrahim%2Fkbc-webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunaidrahim%2Fkbc-webapp/lists"}