This project is a React-based web application for displaying and managing data related to an electricity board. The application allows users to view data, filter it by date and status, and visualize it in graphs. The backend is powered by Flask and MySQL.
- Display and filter electricity board data.
- View and edit detailed information in a modal.
- Filter data by date range.
- Visualize data in graphs by date and status.
- Responsive design using Bootstrap.
- React (version 18.x or later)
- Node (version 20.x or later)
- npm (version 10.x or later)
- Python (version 3.x)
- Flask (version 3.x)
- MySQL Workbench
-
Navigate to backend directory:
cd ElectricityBoard_Backend -
Set up a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` pip install -r requirements.txt
-
Set up MySQL:
- Ensure MySQL Workbench is installed and running on your machine.
- Create a MySQL new Connection provide a name and set the host and port as follow
http://127.0.0.1:3306. - Create a database named
electricity_board. - Update the MySQL configuration in
app.pywith your database credentials.
Note: Make sure the DB is hosted on
127.0.0.1and listens to port3306 -
Run the Flask server:
flask run
Note: The flask application is now running at
http://127.0.0.1:5000
-
Navigate to the frontend directory:
cd ElectricityBoard_Frontend -
Install the frontend dependencies:
npm install
-
Run the React development server:
npm start
App.js: Main application component that defines the routes.Dashboard.js: Component to display the dashboard with charts.GraphComponent.js: Component to display the graph view.DisplaydataComponent.js: Component to display and filter data in a table.ModalComponent.js: Component to display and edit detailed information in a modal.LoaderComponent.js: Component to display a loading spinner.HeaderComponent.js: Component to display the header.index.js: Entry point of the React application.
app.py: Main application component that defines the routes.