{"id":18673901,"url":"https://github.com/baadjis/peoplecounter","last_synced_at":"2026-04-09T23:07:16.693Z","repository":{"id":102072294,"uuid":"399036964","full_name":"baadjis/peoplecounter","owner":"baadjis","description":"python and react web app","archived":false,"fork":false,"pushed_at":"2021-10-02T15:20:14.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-17T08:30:38.411Z","etag":null,"topics":["api-rest","flask","flask-restful","python","react","react-hooks","react-testing-library","unittest"],"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/baadjis.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,"zenodo":null}},"created_at":"2021-08-23T08:59:15.000Z","updated_at":"2021-10-02T15:20:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"2999fdc6-d942-40ed-aa4a-8f846a3fa26b","html_url":"https://github.com/baadjis/peoplecounter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/baadjis/peoplecounter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baadjis%2Fpeoplecounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baadjis%2Fpeoplecounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baadjis%2Fpeoplecounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baadjis%2Fpeoplecounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baadjis","download_url":"https://codeload.github.com/baadjis/peoplecounter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baadjis%2Fpeoplecounter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271415496,"owners_count":24755639,"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-08-21T02:00:08.990Z","response_time":74,"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":["api-rest","flask","flask-restful","python","react","react-hooks","react-testing-library","unittest"],"created_at":"2024-11-07T09:16:58.478Z","updated_at":"2026-04-09T23:07:16.662Z","avatar_url":"https://github.com/baadjis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# peoplecounter\n\nA web app written in python(for the backend) and React(for the frontend)\nto count meetings room occupancy\n\n## Backend \n\nThe backend contains a REST API built with flask and flak_restfull.\n\nThe API has 4 endpoints:\n\n\n ### /api/sensors\n\n  list of all sensors:\n\n `GET /api/sensors/`\n\n curl \u0026nbsp; -i \u0026nbsp; -H \u0026nbsp; 'Accept: application/json' \u0026nbsp; http://localhost:5002/api/sensors\n\n add a sensor to a room:\n\n  `POST /api/sensors/`\n\n curl \u0026nbsp;-i  \u0026nbsp; -H \u0026nbsp; 'Accept: application/json' -d 'sensor=abc\u0026room=1'\u0026nbsp; http://localhost:5002/api/sensors\n\n\n ### /api/meetings\n\n \n  list of all meetings:\n\n `GET /api/meetings/`\n\n curl \u0026nbsp;-i  \u0026nbsp; -H \u0026nbsp; 'Accept: application/json'\u0026nbsp; http://localhost:5002/api/meetings\n\n add a new meeting in a room at a given date:\n\n  `POST /api/meetings/`\n\n curl \u0026nbsp; -i \u0026nbsp; -H \u0026nbsp; 'Accept: application/json' -d 'ts=abc\u0026reason=dev workshop' \u0026nbsp; http://localhost:5002/api/meetings\n\n### /api/occupancy\n\nget the occupancy reported by a sensor at a given date\n\n `GET /api/occupancy/`\n\n curl \u0026nbsp; -i \u0026nbsp; -H \u0026nbsp; 'Accept: application/json' \u0026nbsp; http://localhost:5002/api/occupancy?sensor=xyz\u0026atInstant=2018-11-14T14:00:00Z\n\n\n### /api/webhook\n\nget all reports by sensors\n\n `GET /api/webhook/`\n\n  curl \u0026nbsp;-i \u0026nbsp;-H  \u0026nbsp;'Accept: application/json' \u0026nbsp; http://localhost:5002/api/webhook\n\n\n\n## Frontend \n\nThe frontend is a single page app built with React(react,react-router-dom)\nwith 3 routes:\n\n/ : the home page with basic instructions\n\n/sensors: containing the list of sensors by rooms\n\n/occupancy: containing the ui for occupancy reporting\n\n## Usage:\n\n### Install \n\n\nfirst clone this repository\n\ngo to the backend  directory and install requirement.txt\n\nlaunch the backend server:\n\n```\n\n$ cd backend\n$ pip install -r requirements.txt\n\n```\n\nin a another terminal go to the frontend directory \ninstall the  node modules and launch the frontend(make sure the backend server is still running)\n\n```\n$ cd frontend\n$ npm install\n\n```\n\n### Run\n\nTo run the app first run backend server(in the backend terminal):\n\n```\n\n$ python app.py\n\n```\n  and launch the frontend in another terminal\n\n```\n$ npm start\n```\n### Testing\n\nthe backend unitary test is built with the unittest package\nto run the test run test.py file \n```\n$ python test.py\n```\n\nThe frontend test is built with react testing-library\nin the file app.test.js\n\nrun this command :\n\n```\n$ npm test\n```\n\n\n## Next todos\n\nIn the future we will add:\n\n* a register/login system\n\n* a ui for sensor configuration(add and update,delete)\n\n* a ui for adding meetings \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaadjis%2Fpeoplecounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaadjis%2Fpeoplecounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaadjis%2Fpeoplecounter/lists"}