The SvelteKit Refactor

Sep 12, 2021

See the code for this post on GitHub

To make things a little easier on myself while I work on the next phase of the project, I thought it might be wise to have a system in place to handle page layouts and routing. Svelte itself is great for building components and managing state, but I'll soon have to think about having different pages for user account management, an "about" page, and so forth.

I've been building this portfolio site and blog with SvelteKit, and getting more comfortable with using Svelte in that context. It was a pretty straightforward Sunday afternoon project to take the raw Svelte components I had built for the POC app and lift-and-shift them onto a blank SvelteKit project. I think I've got a bit cleaner of a folder structure now, too. The routes folder handles site content and layout, and the bulk of the application logic and components have been moved to the lib folder.

I anticipated running into more issues getting things to load once I moved all the files. Aside from having to fix some red squigglies in filepath references, everything just started working as expected. I thought I'd at least have issues with the Static Web Apps deployment, but that didn't skip a beat either. Fingers crossed that user authentication goes this smoothly!

© 2022 Andrew Iafrate. Contact me for questions or comments.