You are browsing as a guest. Sign up (or log in) to start making projects!

4h 40m 42s logged

SQL Database, Website Backend, Dashboard

When I said a lot last time…that was nothing compared to now ;-;

What am I going on about?

Well, I wanted a way for station owners to be able to be able to toggle maintenance mode without the admin (whoever deploys this for their own mesonet) directly editing a json file every time. One thing led to another and now I am making a website…

Website Plan:

This website will run on a FastAPI backend with either Jinja2 or Htmx front-end. There will be a public “dashboard” where anyone can take a look at general station stats and current weather conditions. The weather conditions will also be made graphical with Matplotlib. Historical data will also be accessible. However on the same site, people will be able to log in. Logged in users will be able to access only certain stations they are allotted. They will have a more detailed dashboard with more stats. Certain users will be able to toggle maintenance mode and some won’t. Admin accounts will be able to see and toggle for all stations. Usernames and passwords will be hashed and saved in the database. The log in system will also make use of cookies/sessions to keep the user logged in.

Planned SQLite Models

users: (DONE)

  • id
  • username
  • password_hash
  • role (admin, station staff, etc)

user_station_access

  • user_id
  • station_id
  • can_view
  • can_toggle_maintenance

stations:

  • id
  • station_id
  • is_in_maintenance
  • is_public

station_status:

  • station_id
  • last_status
  • consec_offline
  • first_offline
  • last_conected
  • alert_sent

station_current_weather:

  • temp
  • dew
  • humd
  • wind_speed
  • wind_gust
  • wind_dir
  • pressure
  • precip_rate
  • precip_accum
  • uv
  • solar

Progress?

I have made all the models and created basic routes. There is a CRUD (Create, Read, Update, and Delete) for the stations based on another config file. On start, the program will automatically create database entries for new stations and delete ones not in the config file.

0
2

Comments 0

No comments yet. Be the first!