Welcome to the LOOP_APP(Restaurant Online Status Monitoring System). This system is designed to monitor the online status of several restaurants in the United States and provide detailed reports on the occurrences of restaurants going offline during their business hours. This documentation will guide you through the installation, configuration, and usage of the system.
Loop is responsible for monitoring the online status of multiple restaurants across the US. Each restaurant is expected to be online during its business hours. However, occasionally, restaurants may go offline for unknown reasons. To address this issue, restaurant owners require a report detailing the frequency of such incidents in the past.
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
- first of all, You need to install python for running pip command
- create a project folder
- setup Postgresql for your pc
- Clone the repository inside this folder
https://github.com/divyanshkumarworks/Loop_App.git
- Install Dependencies
pip3 install -r requirements.txt
- Run database migrations using:
python manage.py makemigrations
python manage.py migrate
it will create the database schemas, tables and relationships.
- And then run:
python manage.py runserver
this command will run the local server.
-
/trigger_report
triggers report generation from the data provided (stored in DB)- No input
- Output - report_id (random string), report_id is used for polling the status of report completion
Request/Response
http://127.0.0.1:8000/trigger_report { "report_id": 14 }
-
/get_report
returns the status of the report or the csv- Input - report_id
- Output
- if report generation is not complete, return “Running” as the output
- if report generation is complete, return “Complete” along with the CSV file with the schema described above.
- if any kind of error occurs in between the process and the request is not completed, it returns “Error occurred” as the output
Request/Response
http://127.0.0.1:8000/trigger_report/14 { "status": "Complete", "csv_file": "C:\\Users\\rishu\\projects\\Loop_App\\media\\reports/14.csv" }