ftpaints banner

ftpaints

10 devlogs
13h 17m 43s

A livery sharing collection/database website for PB Formula Truck, similar to Trading Paints for iRacing. Written in Go using Gin

This project uses AI

ChatGPT, Github Copilot for code assistance/review + tab completion

Demo Repository

Loading README...

BnaJns

Shipped this project!

ftpaints is an website/app for sharing and storing livery data such as images, roblox texture id, etc for the PB formula truck league. Works in a really simple way, you login via Roblox OAuth2, and then you can upload your own liveries, and you don’t need to be logged in to view other liveries. I hate docker setup, I will never be doing it again, it was a waste of about 35 minutes of my life. Using gin is really nice, it’s really simple, writing middleware is easy, it has everything I needed. Obviously comparing Go to something like next.js is comparing a living cow compared to an already made cheeseburger, in Go you have to control the flow, next.js has everything set up nicely for you. Overall I’m happy with how it turned out with the time, I procrastinated on it too much, but still got it finished. Go and Gin are awesome

BnaJns

Final devlog probably, at last, after an all nighter, procrasting on this project till the very last hour, I have gotten everything working. Not everything was added but I shall still claim victory and feat. Overall very proud of this tho, golang is good, probably not the best choice for websites like this, tbh performance is good so it probably is worth it, but still.

  • Added post delete button if the post viewer is the post owner
  • Added a cap of 5 images to extra images section
  • Ran task tidy
  • I hate docker why would anyone voluntarily use this
  • Fixed broken stuff
  • Got it deployed on https://ftpaints.bnajns.dev
  • I hate docker
  • Fixed annoying file write issues, fedora is kinda annoying
  • I made the readme a bit tuffer
  • It all finally works perfectly. Amazing.
  • It did not
  • I fixed the commit hash in the footer
  • It works now i hope

I hate docker but im only using it because containerization

Very awesomesauce

Changelog

Attachment
Attachment
Attachment
0
BnaJns

Wow

  • Added settings page with option to logout, and to delete all account data + confirmation modal ofc
  • Added TOS and Privacy Policy pages (via chatgpt) because roblox oauth2 needs it, via .md files rendered via goldmark
  • Cleaned up some bugs, some pages should look a bit cleaner
  • Cookies no longer expire after 15 minutes, set to 30 days now
  • Added max post/request size of 20MB so the server doesn’t receive a 2TB zip bomb as middleware
  • PORT env variable
  • Commit hash is now in the footer

Idk if I can add the individual post delete button in time but I shall try

Changelog

Attachment
Attachment
0
BnaJns

Final stretch 3am lets get this done fr

  • Index/homepage/collection view is 99.9% done now? Everything seems to work nicely, I’m proud of the design, sort filter search works ok, so I can probably consider it done now.
  • /search endpoint added, you throw in the query params, it spits out what it finds, with pagination ofc
  • favicon.ico added
  • Upload button added to navbar to link to /upload

Some stuff left to do:

  • Allow creator to delete posted liveries
  • Commit ID in footer
  • Shut gin up about untrusted proxies
  • Admin page? If I have the time
  • User profiles

peak fr

Changelog

Attachment
0
BnaJns

A lot of work in this one and very awesomesauce progress ts tuff on fonem

  • Livery view frontend basically done, features the data from the SQL data obviously, the roblox texture id with a copy button, featured image and additional images, along with a lightbox, and that’s it
  • Moved htmlrender to its own package because of dependency loop issues
  • You now get properly redirected to the livery page after doing the upload
  • Added functions to the db.postgres for getting user data via id and paint data by id

The layout kinda sucks but I don’t have any better design ideas and it does it’s job, so good enough. I guess the next logical thing to work on is the livery collection frontpage with sorts and allat

I also gotta actually add the logo as a favicon.ico cause rn it doesnt exist and no favicon looks ugly in browsers ofc

I still don’t regret golang and gin for this despite it taking way longer than it would’ve with svelte or next.js or whatever. Trust the process

Changelog

Attachment
0
BnaJns

Got the SQL and upload working now, epic

  • On user upload, does basic validation checks
  • If checks pass, upload images to local file storage
  • If uploads succeed, run SQL insert query
  • If SQL insert succeeds, returns the livery UUID
  • Also made a few small bugfixes

Uploaded images are available via /uploads (or /public/uploads), no frontend for viewing the published liveries exists yet, so I have the choice of working on either the individual livery view, or the collection view first, I’ll prolly just do the individual view first.

Changelog

Attachment
Attachment
0
BnaJns

Progress on getting uploads working:

  • SQL Schema is pretty much set up correctly now with everything needed
  • Frontend is 99% done, just need to finish up backend. Awesomesauce styling
  • Backend is like 50% done, validation exists, but doesn’t run the SQL query/function yet since I need to handle file uploads. Now, initially I thought using minio/garage/rustfs would be the best choice. Then now I’m thinking it’s too much overhead and unnecessary, so what I’ll do instead is probably just storing images and uploads manually in a folder instead.
  • After that’s done, the backend is pretty much done for the upload part, I can wire up the final frontend piece, and boom working uploads. Though I still need the paint/livery view page as well

party-gopher

Changelog

Attachment
0
BnaJns

Time to speedrun ts since flavortown ends in 2 days and exams are over for me so I actually have time now

Very awesome changes and stuff working woah:

  • I setup the base layout/multitemplate so no navbar/footer copy paste
  • Set up the user state middleware/html renderer
  • Slight work on the HTML/Styling
  • Made a cool simple logo in Pinta, since paint.net is not on linux and all the other apps on linux suck

Stuff to do next probably:

  • Upload page
  • Show uploaded liveries on index page
  • Settings/account management

Kaboom

Changelog

Attachment
Attachment
0
BnaJns

Finished up the OAuth woohoo

  • Roblox OAuth2 login with state+PKCE
  • Cookie is stored in db using sha256 + secretkey
  • /whoami endpoint, literally only shows basic stuff such as pfp, id, username/display name

Pretty much hard stuff is done now, I think, so I can start actually working on the frontend and handling uploads and yadayada, and I’ll also have to figure out the best way to do reusable components, aweeeeeeesome

Changelog

Attachment
0
BnaJns

Progress update, i kinda fucked up and lost about 35ish minutes of work because I was working on the project on my laptop, I was also trying out GoLand (which sucks, I’m sticking to VSC), anyways I committed the files to git, BUT, i forgot to push, and then alas, I switched from fedora to cachyos because my laptop is a tractor, and then when I tried to git pull on my PC, it said it’s up to date, I check my laptop, the project files aren’t there, so that’s great. Anyways, current progress is working on getting the login to work and be persistent, I had a docker-compose file on the laptop, which I’ll have to recreate, to use postgresql as the database, goose for SQL migrations, and ofc I gotta finish up this unfinished oauth callback and then I’ll see what’s next

Changelog

Attachment
0
BnaJns

Aight so I decided to make this project/website because the ro-racing league I’m in supports making custom liveries for some cars, but there’s no “database” or anything similar to keep track of, or share liveries reliably, so why not make something similar to Trading Paints (a iracing livery collection/app) to keep liveries with data such as texture id, tags, which car type, team, etc. I decided to go with golang for this since gin-gonic (basically express.js for Go) makes stuff hella easy, and using templates is nice as well, I could’ve used next.js but that’s lame and boring and next.js consumes 1gb ram something something. Anyways, plan is to use: Gin-gonic, postgres, and get minio setup on my homelab for screenshot uploads and such. Only concern is how I’ll figure out reusable components like the navbar and footer and allat since react would make that easy but ofc I can’t use react here, only pure html+css+js. Anyways, so far I’ve setup some basic stuff, such as a uptime tracker, router setup, readme and license, very minimal stuff. So that’s that, Go is very cool. party-gopher

Changelog

Attachment
0