So.. I changed my mind on how I want this new setup to be. I think I have good reason, though.
The Original Idea
My original plan was to create a monorepo. The API, crons, admin area and website would all be in one project or repository. I was going to use PHP with some AlpineJS to make it all happen.
I spent quite a bit of time just getting things set up and working correctly with each other. It was to the point, even after it “worked”, that I was messing around with the environment more than actually making progress. I then had to stop myself, because I still have an obligtation to maintain the current site.
I worked through pulling new streaming data and getting that updated on the site. It’s live. Go me! Also - when I added the last season of anime.. which I’m currently still one behind.. I kind of broke the Crunchyroll links. Oops. It’s fixed now though. While working through that, I realized that I actually like the way I have things currently set up.
Currently the UI is a Nuxt 3 application. The API is some old, custom written PHP code. The admin area is a react app. The cron jobs and data scrapers are in their own directories. I like this - to an extent.
Enter the new plan.
The New Plan
Instead of having everything in a monorepo, I’m going to divide it up where it makes sense. One of the worst things about the UI right now is it’s statically generated - I want to change that to be SSR. Yes, yes that means I’m sticking with Nuxt. I know, I said I wanted to ditch the damn frameworks, but dammit I like Vue. Anyway, there’s a new major version out, so it’s going to be Nuxt 4.
The UI and admin portal are going to be combined into the Nuxt 4 application. I’m going to configure it so that when it’s time to do a production build, the admin stuff is left out. It’s only for me and only needs to work locally. Those two being together means I can share a lot of shit between them (types, I’m looking at you).
I’ve already restructured the PHP repository to be only back-end stuff. So I removed any front-end (Alpine) stuff and removed the need for Twig templates. This is going to act as the API, as well as the home for crons. The thing I need to be careful of is I’m going to have some crons live on the “production” server and others locally. Just need to make sure I keep those straight.
What about the data stuff? Well.. it’s mostly Playwright. I feel like it could go into the UI/Admin repo.. but I honestly just might keep it it’s own separate thing. I have some improvements I want to make on refining the data so it being separate will probably help me keep my head on straight.
So three repos: UI/Admin (Nuxt 4), PHP (API, crons), Data (Playwright)
Another header cause why not
I feel like this will be a good balance of new and existing. I’ll have to learn the quirks of Nuxt 4 and SSR, but in an environment I’m used to. The PHP back-end is quite a bit different - as I’m still going with the controller service model architecture, but having it solely back-end will make it easier to manage and focus on.
One thing I will have to figure out is because the UI will be SSR hosted on Cloudflare, and API PHP on my current host, DreamHost, I’ll have to do some fenagling. I’m fairly positive all I need to do is set up a proxy within Nuxt and make sure all requests are pushed through a global fetcher. So Nuxt will hit /api/anime/log-horizon and that will be sent to Dreamhost as /anime/log-horizon or something like that.
Anyway, that’s the new plan. Fuck, it’s 11 o’ clock.
My daughters have been waking up at 5am. I’m cooked.