Skip to content

A project for CPSC 321 (Database Management Systems) that is an interactive website for viewing stats relating to the 24 Hours of Le Mans race.

License

Notifications You must be signed in to change notification settings

Ben10164/24h-lemans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

24 Hours of Le Mans

pages-build-deployment Code style: black

(ER Diagrams are located in docs/ as well as embedded at the bottom of this README.md)

How to run

Docker

  • docker build -t streamlit .
  • docker run -dp 8501:8501 streamlit
  • In a browser, navigate to localhost:8501
  • That should be it!
  • Also if you are unfamiliar with docker, to stop this process you run docker stop xy where xy is the output from the 3rd bullet point

Manual

0. Update data (optional / not recommended)

  1. cd data/
  2. make
  3. Wait for this Makefile to finish downloading and running the scripts.
  4. This will result in a new file data/results_in_generated.csv to be created, but most likely it will include processing errors. Because of this, I recommend using the existing data/results_in.csv.

1. Creating the database

  1. Start your MySQL/MariaDB server in a terminal: mysql or mariadb.
  2. Create a new database CREATE DATABASE lemans24; (you can name it anything, but in this example I named it lemans24).

2. Importing data into the database

  1. Use your newly created database: USE lemans24;.
  2. Run the 4 following scripts in data/ (cd data):
    • SOURCE 0-results_in.sql
    • SOURCE 1-create_tables.sql
    • SOURCE 2-create_procedures.sql
    • SOURCE 3-insert_data.sql
  3. If everything works, you should have the output Query OK, X rows affected.

Run streamlit

  1. Make sure you have all the packages installed: pip install -r requirements.txt.

  2. In the directory .streamlit/, modify the file named secrets.toml. It is already added to the git ignore, so the changes won't affect anything

    # .streamlit/secrets.toml
    
    [connections.mysql]
    dialect = "mysql"
    host = "localhost" # whatever your sql host is (localhost)
    port = 3306 # your sql host post
    database = "lemans24" # whatever you named your newly created database
    username = ""
    password = ""
  3. Run the streamlit app in the base repo directory: streamlit run Home.py.

ER Diagrams

Diagram 1 Diagram 2

About

A project for CPSC 321 (Database Management Systems) that is an interactive website for viewing stats relating to the 24 Hours of Le Mans race.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •