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_promotions
route allows adding new promotions or removing existing ones via POST requests. Promotions are stored in a CSV file (promotions.csv
). -
Get Promotions: The
/get_promotions
route retrieves the list of promotions from the CSV file.
-
Login: Users can log in through the
/login
route, providing their username, password, and role. Authentication is performed against user data stored inusers.csv
. -
Add User: The
/add_user
route 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_chart
route 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.py
The 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_promotions
route using POST requests.
- Add new promotions or remove existing ones through the
-
User Management:
- Log in via the
/login
route with a valid username, password, and role. - Add new users through the
/add_user
route.
- 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!