Back
Similar todos
Got my frontend app deployed to Netlify, it was surprisingly easy. Changed my Cloudflare DNS settings for the domain to point to Netlify, and turned off the 'Proxy' setting in Cloudflare. Changed my frontend and backend code to use the new setup of having the api at a different domain instead of at `/api/` at the same domain. Tomorrow I'll need to test that local development is still working properly and then see if I can get it working on Netlify/DigitalOcean.
Continuing to try to get Dokku working with a monorepo; I think I got past my last problem of how to deploy both apps by running on the server `dokku builder:set backend-app build-dir backend` (and similar for the frontend); now I'm seeing a new error when I try to deploy the frontend app: `Two different lockfiles found: package-lock.json and yarn.lock`; I seemed to fix it by deleting the yarn.lock. New error: "Missing script: start"; fixed that by adding a 'start' entry to my package.json. New error: "Cannot find module '@vitejs/plugin-vue'"; maybe because it's listed as a devDependency? I found this SO post where the guy said he ended up just putting his frontend on Netlify, so maybe I'll try that instead: stackoverflow.com/a/62455021/… ChatGPT is saying the way to do it is to deploy my API at api.mydomain.com and then direct traffic at other subdomains to Netlify to handle frontend requests. So I'll try that tomorrow.
Continuing to look into the CORS error I'm getting when my frontend tries to make an API request to my backend; it seems my backend dokku app wasn't deployed for some reason; destroyed my existing go dokku app and recreated it and then struggled with an error for a while before realizing I had the same issue a few days ago and the solution was to run `dokku builder:set backend-app build-dir backend`; now getting an error saying the download for my specified version of Go is "unknown to the buildpack"; after much trial-and-error I realized the problem was that Dokku has a stupid error message that makes it sound like it has already automatically chosen a Go buildpack when in fact it has not. I was additionally getting confused because I was seeing Dokku installing Go and not realizing that was because of my +heroku instruction in my go.mod file rather than Dokku automatically using a Go buildpack. The solution was to specify a Go buildpack for my app with `dokku buildpacks:add <my-app> heroku/go`. Now getting a new error: "Failed to connect to database". Fixed it by switching my code to use the `DATABASE_URL` environment variable that Dokku creates for your code to connect to the db. My `git push dokku main` finally succeeded, but I'm still getting a CORS error. Eventually figured out it was because my Dokku app name was `whatdo-backend` when I had forgotten that that would also be the name of the subdomain, so I had to delete the app and recreate it with the name `api`. I also created a `/ping` health-check URL to help me debug this more quickly. I'm now getting a 521 error, I think maybe because Dokku is running on http and Cloudflare is reaching out via https?
Only got ~5hrs of sleep after two double espressos yesterday, so I took a Lycopene capsule...signed up for a LinkedIn Premium free trial so I could send a message to a Kasikorn backend engineer to ask why users can't export their transaction history in CSV format...removed the 'Blog' link on nw.com b/c I don't have the WordPress blog up and I never really used the blog that much, added a link to my email address instead so people can contact me...started going through the Kasikorn API "Slip Verification" challenges...got the first one done...the second one requires I have SSL set up on my domain and not through Cloudflare...discovered while doing that that my whatdo site is returning a 404 if I try to sign in...got GoLand's db tool connecting to the digital ocean postgres db b/c I noticed that wasn't set up yet...install postgres on my macbook b/c something got messed up and somehow it seemed to not be installed...got all the db problems fixed, don't know how that happened...now having a CORS issue when running locally, all this stuff was working, IDK how it all broke...ok I remember now, I YOLO'd the backend code and disabled the existing router to get the Line echo bot working...sent an email to another local YouTuber to ask if I can be in a video with him...installed cursor and tried using it for a simple refactor task to get a sense of how it works...figured out a way (thanks to ChatGPT) to get the Line callback handler working while also not breaking the existing routes...went for a massage to give my brain cells some time to recover...used cursor some more and I get the hype, this is really cool, I'm surprised Jetbrains hasn't copied it yet...after a long while I finally got my whatdo backend working properly again (auth + user middleware working), it was a good learning experience with cursor and Go...got a GitHub Action set up so my DO dokku VPS will update when I push to main, so now both frontend and backend will update automatically when I push to GitHub...ending the day on this banger set: www.youtube.com/watch?v=d2340… Tomorrow: I need to bill hours to my client to make $, I want to try to finish the KBank API challenge to see if I can do the Slip Verification, I want to email another YouTuber, if I have any time left over I want to keep going with that Line/ChatGPT bot and try to make a frontend interface for it.
Messing around with cors proxies all day to get data from a gov public endpoint that's blocked by cors/csp. Tried Github's Flat Data too (that uses GH Actions). Didn't manage to solve it. Might try Cloudflare Workers using cloudflare-cors-anywhere instead. #uvindexsg #socialimpactpatronage
Spent an hour reading some of [the backend code][1] for a Go / Vue chat app I saw posted to Reddit, as a way of trying to build familiarity with how my Go / Vue projects should be structured / work.
[1]: github.com/wizzldev/backend/
Got my personal website (nathanwailes.com) being served by Netlify after destroying the Digital Ocean droplet that was hosting it (just an index.html file)...got the welcome YouTube video working again, I guess YouTube requires some new iframe attrs now before it'll allow it to be played...bought a new domain (wailesgroup.com) for $10 and set it up on Netlify with a copy of my nw.com domain, I'm thinking of trying to start doing cold-emailing to get work as an agency / remote-worker management consultancy b/c I think the current agency I'm working for is billing my time at a way higher rate than I'm getting paid...spent a few minutes thinking about and adding Jira tickets for what I should work on next for that project (not today)...spent some time studying the [hnjobs GitHub repo][1] to see how it worked, to use it as a stepping stone towards automating applying to HN jobs...spent some more time thinking about trying to do interviews with YouTubers, I'm now thinking it may not be so useful, as I don't have a product I'm trying to sell right now, it's unlikely to have any lasting impact, and it would probably be a one-time thing... [1]: github.com/nchelluri/hnjobs/