Website Backend, JWT, and HTML Front End
Ok, these dev logs keep getting exponentially longer and longer ;-;
What the hell is JWT?
JWT (JSON Web Token) is a way for my authenticate a user. It essentially is how I can do logins. When a user is registered, their username and hashed password is stored in the SQL database (DB). When someone would like to authenticate, their password is hashed and sent with the username. The DB check if the username and hashed password match and send back a JWT token that expires after a set time (30 mins but configurable). During this time the user would be able access their station dashboard, etc. Admin accounts have the same log in procedure. They however have the power to give each user (based on their user id in the DB) access to specific stations. This includes the ability to see the station dashboard, toggle maintenance mode, and toggle if the station is public (on our site).
Backend:
Added functions for creating accounts and logging in. Most functions now require either a general account or a admin account. If this is not fulfilled a 401 error is sent (Unauthorized error). As of right now, only admins can register accounts. The access to each station can be updated by a admin at any time. I did some more stuff but I honestly forgot :)
HTML Front End
This was honestly my favorite part so far. I started by getting the Jinja2 template system to work as well as mounting the static directory. The layout.html file allows me to change it slightly for every page. That is a bad explanation but it is a really cool system. I got the home page done (needs some text and description but thats a later me issue). I am working on getting the general station page. It will list every station and allow you to click on them to get forwarded to that stations public dashboard.
Sanity Check?
I am having so much fun with HTML. It gives a certain gratification that SQL can’t give. I feel very happy :D
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.