Giter VIP home page Giter VIP logo

chartdashboard's Introduction

Admin Dashboard Project

Description

This is a simple admin dashboard that fetches data from a MySQL database and visualizes it in the form of charts. For chart visualization, we have used the Google Charts API.

Steps to Run This Flask App

1. Clone This Repository

git clone "https://github.com/ChoudhariNikita/ChartDashboard.git"
cd ChartDashboard

2. Install Required Dependencies

pip install -r requirements.txt

3. Update MySQL Database Credentials

Open app.py and update the MySQL database credentials with your own:

def get_mysql_connection():
    return mysql.connector.connect(
        user='your-username',
        password='your-password',
        host='your-host',
        port=your-port,
        database='your-database-name'
    )

4. Create Database and Table

Login to your MySQL server and create the required database and table using the following SQL query:

CREATE TABLE energy_outlook (
  id INT NOT NULL AUTO_INCREMENT,
  title VARCHAR(500),
  sector VARCHAR(100),
  topic VARCHAR(100),
  insight VARCHAR(255),
  url VARCHAR(500),
  region VARCHAR(100),
  start_year VARCHAR(10),
  end_year VARCHAR(10),
  impact VARCHAR(100),
  added DATETIME,
  published DATETIME,
  country VARCHAR(100),
  relevance INT,
  pestle VARCHAR(100),
  source VARCHAR(255),
  likelihood INT,
  intensity INT,
  PRIMARY KEY (id)
);

5. Load Data Into the Database

Execute load.py to load JSON data into the database. Ensure load.py contains the necessary logic to insert data into the energy_outlook table.

python load.py

6. Run the Flask Application

Finally, run app.py to start the Flask application.

python app.py

Open your web browser and navigate to http://127.0.0.1:5000/dashboard to view the admin dashboard with data visualizations.

Conclusion

With these steps, you should be able to set up and run the admin dashboard application on your local machine, visualizing data from your MySQL database using Google Charts. If you encounter any issues, feel free to seek further assistance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.