Problems with marp server scripts

Had to write this down somewhere for now… currently my echo server is getting slides as a string from the marp server. But maybe I should instead just proxy my marp server with Caddy and put an iframe with the reverse proxy link to the slides? One big issue here is that the js in marp slides assumes the client is local host and it’s trying to establish a websocket connection for live reload or something. So maybe I do need to filter that out with my app.

March 29, 2025

Tabs

Static site lesson details now uses tabs component to display slides, files, and assessments rather than trying to cram it all on one page. Looks great! Static site file viewer UI is looking great too, and the recursive part wasn’t as bad as I expected! Realized I need to reorganize my project eventually to slice vertically according to features instead of horizontally according to layers. That seems to be the recommended approach nowadays compared with the older MVC approach. Of course this realization comes only after I have thoroughly entangled my features with each other according to layer (e.g. this monster NodeHandler interface) Pushed to remote in a matter of minutes and it works fantastic.

March 27, 2025

Its been a while

Built a very smooth development and deployment setup this week with Docker compose including nice task shortcuts. Decided yesterday that I eventually want to make the following changes: Use Kubernetes instead of Docker compose for production (probably overkill, but would facilitate scaling and need to learn it) Postgres instead of sqlite3 Separate container for filesystem access to facilitate scaling up ValKey (open source fork of Redis) for caching files Nix instead of docker for development, possibly production as well But first I want to get this working completely for testing in beta so that I can share with a few select colleagues. Lots of changes since last entry. Today is a day to celebrate, as I finally got the whole thing working on my remote server. 3 containers running caddy, echo app, and marp respectively. Caddy is reverse proxy for echo and at {username}.course-manager.app caddy serves static sites. It all works! I can’t believe it! 🥳😭 App is still registered as ’testing’ not ‘published’ in google cloud console so I would need to add specific users until I publish it (authorized redirects cannot be http for published apps) Created unauthorized page and types and functions for responding to various unauthorized user scenarios Configured signin/signup route handlers to disallow non-cms gmail accounts

March 22, 2025

More files!

Added the files capability to units and courses in the same way that it’s available in lessons. I am increasingly noticing there’s a tremendous potential for consolidating code to accommodate CourseNode interface and replacing the particular functions and data for course, unit, lesson, etc… This could cut down the total lines by at least 50%, if not more, and could make it more maintainable. I am very trepidatious about it though because it could be a lot of work and would have to be done with great care.

February 19, 2025

Elusive bugs

Something interesting happened to me today. Nasty bug because I accidentally returned nil instead of err when err != nil, so it took me a while to find: { "error": "sql: Scan error on column index 5, name \"user_id\": converting driver.Value type float64 (\"1.0160211027267435e+20\") to a int64: invalid syntax", "message": "Internal Server Error" } I am not sure what caused this, but hopefully will remember to write here what happened! I suspect it has something to do with my changing the id params type to an interface instead of integer but I thought any risk of doing so would be confined to the scope in which params was made; I did not think it could somehow infiltrate all the way down into SQL code. It looks like it’s interpreting the user ID as a float. So that’s an issue. The bigger question is why is the userID getting passed in instead of the termID? Ok, the problem was very simple, and had nothing to do with the above. I hand’t changed the Term’s UserID field from int to string, so it was trying to read the number to an int. 🤦🏻‍♂️

February 17, 2025

Deployment begun!

Deployed to Digital Ocean Droplet (see .env for IP) Purchased domain course-manager.app

February 16, 2025

Hugo?

I’ve made a ton of additions/changes, just haven’t been writing here lately. I do want to mention that I spent several days exploring the possibility of using Hugo for site generation, but today I decided that having to use go templates vs. templ was not obviously worth the benefits as far as I could see. Templ is just way, way easier to write UI with. The extra serialization required for using Hugo was also a major drag, having to pass data programmatically through markdown really did not seem worth it. A lot of my decision was just realizing the steepness of the learning curve involved. Templ is working just fine for me, and I just parallelized the site generation so that will help with the small performance concerns I had. ...

February 6, 2025

Going nuts

1/24/2025 Went a bit nuts today with the scale of changes. Changed the filesystem to a nested one so that deleting a node (term, course, unit, lesson) will delete all of its children. For deleting things, I have a confirmation on the UI but maybe it’s still a bit too easy to delete a lot of work, potentially forever! Major change to static site in that I changed the directory names to match the server’s new file structure so that I can simply copy the entire directory over once, including slides, images, and files, and then just render the pages. Vastly simpler than what I was doing before. ...

January 24, 2025

Cleaning up

1/23/2025 Didn’t accomplish as much today due to time constraints. Cleaned up NodeList and NodeDetails components code by adding corresponding methods to the PageData structs.

January 23, 2025

Upload/View files implemented!

Added ability to view and upload lesson files. Went a lot quicker than I expected.

January 22, 2025