so i already learned the basics of svelte, so i think i'll want to get more creative.
i decided to make the music page exist. you can see that here, but if you view this later on it might be modified.
let's break this down
first of all, for data i'm using mongodb + mongoose. the website now has a lib folder with a handful of utilities, and they are orginized like this:
- lib/client: client-side classes for representing db objects.
- lib/db: server-side mongoose models and connection.
- lib/components: svelte components. currently only has <BackButton />.
- lib/hooks: hook functions i can use in my svelte components.
- lib/svg: svg icon files. these use the
then i wrote the api route that has music data, which is a SvelteKit endpoint, which basically
wraps the mongoose
since the data structure include a Map and a Date object, i wrote a small class on the client side which wraps the JSON data and adds back the fancier types. this just improves the developer experience.
if you would like to play around with the data, i made
MusicArtifact classes available in the development console, and if the data is
visible above, that is available in the
i apologize for the delay in todays post
© dave caruso 2021. all rights reserved.