This repository contains a Flask application for managing promotions and user data for a sushi website. The application includes features such as updating promotions, user authentication, and real-time chart updates.
-
Update Promotions: The
/update_promotionsroute allows adding new promotions or removing existing ones via POST requests. Promotions are stored in a CSV file (promotions.csv). -
Get Promotions: The
/get_promotionsroute retrieves the list of promotions from the CSV file.
-
Login: Users can log in through the
/loginroute, providing their username, password, and role. Authentication is performed against user data stored inusers.csv. -
Add User: The
/add_userroute allows adding new users with a username, password, and role. User data is stored inusers.csv.
-
The application provides a homepage (
/) with a chart displaying sample data. -
Real-time Chart Updates: The
/update_chartroute allows updating chart data dynamically. The chart data is stored and retrieved from the server.
- The application includes pages for monitoring (
/monitoring) and updating (/updating).
-
Clone the repository:
git clone https://github.com/your-username/FlaskProject.git -
Install dependencies:
pip install -r requirements.txt -
Run the application:
python app.pyThe application will run in debug mode, accessible at http://127.0.0.1:5000/.
-
Promotions Management:
- Add new promotions or remove existing ones through the
/update_promotionsroute using POST requests.
- Add new promotions or remove existing ones through the
-
User Management:
- Log in via the
/loginroute with a valid username, password, and role. - Add new users through the
/add_userroute.
- Log in via the
-
Chart Data Visualization:
- Explore the sample chart on the homepage (
/). - View real-time updates on the monitoring page (
/monitoring).
- Explore the sample chart on the homepage (
Feel free to contribute to the project by opening issues or submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- The Flask framework and its contributors.
- Chart.js for the chart visualization.
- Other open-source libraries used in this project.
Thank you for using and contributing to the FlaskProject!