{"id":14065442,"url":"https://github.com/Shikha-code36/Restaurant-Monitoring-System","last_synced_at":"2025-07-29T20:32:49.462Z","repository":{"id":114296831,"uuid":"606076605","full_name":"Shikha-code36/Restaurant-Monitoring-System","owner":"Shikha-code36","description":"Backend system for restaurant management ","archived":false,"fork":false,"pushed_at":"2023-02-24T14:57:02.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-24T03:31:46.799Z","etag":null,"topics":["backend","backend-api","cache","cache-storage","caching","flask","flask-api","flask-backend","flask-restful","flask-sqlalchemy","multithreading","multithreading-library","pandas","pandas-dataframe","pandas-python","python","python3","sqlalchemy-database-migrations","sqlalchemy-python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Shikha-code36.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":"2023-02-24T14:47:05.000Z","updated_at":"2024-04-30T08:55:08.000Z","dependencies_parsed_at":"2023-03-17T19:45:17.291Z","dependency_job_id":null,"html_url":"https://github.com/Shikha-code36/Restaurant-Monitoring-System","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shikha-code36%2FRestaurant-Monitoring-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shikha-code36%2FRestaurant-Monitoring-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shikha-code36%2FRestaurant-Monitoring-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shikha-code36%2FRestaurant-Monitoring-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shikha-code36","download_url":"https://codeload.github.com/Shikha-code36/Restaurant-Monitoring-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228046152,"owners_count":17861101,"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","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","backend-api","cache","cache-storage","caching","flask","flask-api","flask-backend","flask-restful","flask-sqlalchemy","multithreading","multithreading-library","pandas","pandas-dataframe","pandas-python","python","python3","sqlalchemy-database-migrations","sqlalchemy-python"],"created_at":"2024-08-13T07:04:29.678Z","updated_at":"2024-12-04T04:31:10.135Z","avatar_url":"https://github.com/Shikha-code36.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Restaurant Monitoring System\n\nThe Restaurant Monitoring System is a backend API that helps restaurant\nowners track the online and offline status of their stores during\nbusiness hours. The system polls each store roughly every hour and\nrecords whether the store was active or not in a CSV file. The system\nalso has data on the business hours of all the stores and the timezone\nfor each store.\n\nThe system provides two APIs:\n\n1.  /trigger_report endpoint that triggers the generation of a report\n    from the data provided (stored in the database). The API has no\n    input and returns a report ID (a random string). The report ID is\n    used to poll the status of report completion.\n\n2.  /get_report endpoint that returns the status of the report or the\n    CSV. The API takes a report ID as input and returns the following:\n\n    -   If report generation is not complete, return \"Running\" as the\n        output\n    -   If report generation is complete, return \"Complete\" along with\n        the CSV file with the following schema: store_id,\n        uptime_last_hour(in minutes), uptime_last_day(in hours),\n        update_last_week(in hours), downtime_last_hour(in minutes),\n        downtime_last_day(in hours), downtime_last_week(in hours) The\n        uptime and downtime reported in the CSV only include\n        observations within business hours. The system extrapolates\n        uptime and downtime based on the periodic polls we have ingested\n        to the entire time interval.\n\n## Data Sources \n\nThe system has the following three sources of data:\n\n1.  A CSV file with three columns (store_id, timestamp_utc, status)\n    where status is active or inactive. All timestamps are in UTC.\n\n2.  A CSV file with data on the business hours of all the stores. The\n    schema of this data is store_id, dayOfWeek(0=Monday, 6=Sunday),\n    start_time_local, end_time_local. These times are in the local time\n    zone. If data is missing for a store, assume it is open 24\\*7.\n\n3.  A CSV file with data on the timezone for each store. The schema is\n    store_id, timezone_str. If data is missing for a store, assume it is\n    America/Chicago. This is used so that data sources 1 and 2 can be\n    compared against each other.\n    \n**_NOTE:_**  Data files cannot be pushed due to lfs issue \n     \n         #### Files structure \n         \n         ```\n            data/\n            \n              ├── business_hours.csv\n              \n              ├── stores.csv\n              \n              └── timezones.csv\n            ```\n\n## System Requirements \n\n* The data sources are not static, and the system\nshould not precompute the answers. The system should keep updating the\ndata every hour. \n* The system should store the CSVs into a relevant\ndatabase and make API calls to get the data.\n\n## Installation \n\nTo install the required packages, run the following command in the project directory:\n```\n    pip install -r requirements.txt\n```\n\n## Usage\n\nTo start the server, run the following command in the project directory:\n```\n    python run.py\n\n```\n\nThe server will start running on http://localhost:5000\n\nNote: Remember to add url prefix in the api like http://localhost:5000/api\n\n## API Documentation\n\n- ### /trigger_report\n\n    This endpoint triggers the generation of a report from the data provided (stored in the database).\n\n    * Request\n    ```\n    POST /api/trigger_report HTTP/1.1\n\n    ```\n    * Response\n    ```\n        HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n        'message': 'Success', \n        'error_code':200,\n        \"report_id\": \"random_string\"\n    }\n\n    ```\n\n- ### /get_report\n\n    This endpoint returns the status of the report or the CSV.\n    \n    * Request\n    ```\n    GET /api/get_report?report_id=random_string HTTP/1.1\n\n    ```\n    * Response\n    ```\n        HTTP/1.1 200 OK\n        Content-Type: text/csv\n\n        store_id, uptime_last_hour(in minutes), uptime_last_day(in hours), update_last_week(in hours), downtime_last_hour(in minutes), downtime_last_day(in hours), downtime_last_week(in hours)\n        1, 60, \n\n\n    ```\n\n## Functionalities \n\nUsed advance python features like -\n - Multithreading\n - Caching\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShikha-code36%2FRestaurant-Monitoring-System","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FShikha-code36%2FRestaurant-Monitoring-System","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShikha-code36%2FRestaurant-Monitoring-System/lists"}