ssr  [clear]
Miscellaneous / Technical

This post is here for my old brain so I can refer to it in the future when I make updates again without scratching my head (too much).

Updates

  • added the more robust ngx editor options for better html support via app module.

  • added more meta tags (title) and fixed description to strip html when a link is posted elsewhere (twitter). This is related to SSR func., and makes those cards adhere to standards (like anyone cares).

  • recently made a separate app via Xcode/swift to upload images in more controlled fashion. It works better than the built in web uploader, but it’s still a colossal pile of…

  • update tweet functionality so it works with v2 api and it uploads up to three images (I dont like the way four looks). Did not have to get new keys, which was nice. Deprecated the old tweet func altogether.

Fixes

  • fixed the backend so that the blog post comments would upload again. This was related to not having the two way binding configured correctly.

Notes for Deploy

  • when updating site dist files, make sure to restart pm2 service for main as this is the server js file that makes SSR work. The server process in pm2 is for the node api.

  • don’t worry about copying all the node files over, just the ones you update. It’ll work. Update the env vars after deploy.

  • always make sure to edit the env props in two files in ng as this does not work auto for some reason (even though it should and I dont care/mind if it doesnt). edit: this is fixed for the angular front end now.

Other Things and ToDos

Make the web-based image uploader good one day…

Update Angular to newest version soon.

I always tell myself to update the CSS, but I actually don’t mind it, even though I know it could be better - I just don’t have the design chops, but there’s nothing terribly wrong with it either. I once asked my brother to take a look at the earliest design of this site and he did direct me in the right direction as the initial idea was trash.

I also want to add the ability to edit the post directly from the public posting, and to produce a better dedicated editor file for that. Currently, the editor is too simple and a PITA to use.

Finally, just noticed that the CSS does not format correctly for chrome (but it does in safari).

Miscellaneous / Technical

Redeployed the site after bringing the development environment past v15, adding a route resolver to the main route, and tweaking the CSS on main page to simplify things - make it look cleaner and less cluttered. There’s a simpler version more efficient version of this main layout as well. I’m not a designer, which is obvious, but I figured if I kept things simple, the would look good, but things never look right to me.

Keep thinking like Marie Kondo until I get there I guess.

As well as this update, please accept this assortment of random images I generated via mid journey with various prompts inspired by Treasure games, and other weird pics hanging out in my screen shot and download folders.

Additional Images
...
...
...
...
...
...
...
...
...
...
Comments
Admin Saturday, December 17, 2022
test comment post deploy
Miscellaneous / Technical

I finally managed to add server side rendering to the site - which has been on the wish list for a year now. The only real benefit is meta data and cards, making it nicer to share links (cards do look great on discord) and I guess SEO, which, who cares? This is not a money making endeavour.

While everything works well enough, the code behind this site is a mess as I worked from a copy of the non universal site with the expectation that it was an experiment and with little regard to code quality.

But, here we are…I’ll clean it up, I guess.

The biggest hang-up was configuring nginx on the production side as the proxy settings were wrong right from the start. Nothing more infuriating than something working fine in dev and then breaking in prod - hours of confusion later and all it took was a lucky google search. Sometimes it’s best to walk away when you’re stuck on a problem and the answer usually comes to you - and by that I mean it comes to you via some random dude on GitHub. Comment left for that gentleman - a sincere thanks, stranger.

On the plus side, the path of debugging led me to add a few new back end features I would likely not have.

For the moment, this bookends the recent changes to the site, which also includes style, comment, and routing updates. I’ll let the site ‘breath’ for a bit before I resume updating it in the new year.

Up next is getting the site updated to current angular version without breaking anything, making administering the content and data less of a mystery, and updating the backed node express server to not be a complete disaster (image uploading can be hit or miss). Wish me luck.

P.S. The images are random tests from the b-roll. The header image (currently a skull on a beach by an old crt) was generated by open ai’s dall-e via a similar prompt.

Additional Images
...
...
...
Comments
Admin Sunday, December 11, 2022
testing direct comment
Anonymous User Sunday, December 11, 2022
have had tons of pain involving nginx before
Admin Sunday, December 11, 2022
This was my first headache, but I can't even remember why I switched from apache to nginx last year. It might have had something to do with the reverse proxy settings being easier to wrap my head around - which came in handy at first because I needed to set a second one up to handle angular's server side render js redirect on top of the api's redirect. Just glad someone was able to post their config, even though I'm still not quite sure why this config works and my other one didn't. In short, I'm too idiotic to be doing this.