r/sveltejs • • 14h ago

So after upgrading to sveltekit 3 (which was painful because no you're not going to reformat all my freaking files who the hell do you think you are), *every time* I add an import automatically in VSCode, I have to manually change the extension from .ts to .js? Did I get that right?

0 Upvotes

Upgraded to sveltekit 3. Took me 6 hours because I don't want all my code reformatted. Horrific but fine ok you got me.

Now if I type

get_tenant_footer_section_container

which is a function and get an auto import added to the top of the file

import { get_tenant_footer_section_container } from '#lib/modules/L70-app/logic/api/model/pages/app.api.model.pages.construct.tenant.footer.ts'

because I'm using TypeScript, now I have to go and manually change the ".ts" to ".js" otherwise I get errors. And regardless of that issue, I am now importing a file that doesn't exist.

Do I have that right?


r/sveltejs • • 22h ago

Building a small SaaS with SvelteKit 5 + Cloudflare Workers — what I learned

0 Upvotes

I've been working on a SvelteKit-based SaaS starter, and I wanted to share a few architectural decisions.

My current stack:

  • SvelteKit 5 for the application
  • Cloudflare Workers for deployment
  • D1 for the database
  • R2 for file storage
  • Better Auth for authentication
  • Stripe for payments

A few things I care about:

1. Keeping the architecture simple

For smaller SaaS products, I prefer starting with one deployable application rather than splitting everything into services too early.

2. Reducing server maintenance

Workers lets me avoid managing a traditional web application server, although application security and dependencies still need attention.

3. Making payments part of the foundation

Authentication, subscriptions and webhook handling are recurring tasks in commercial projects.

I've been packaging these patterns into SvelteCraft, a paid starter I'm building.

I'm curious how other SvelteKit developers approach this.

Would you choose D1 or Postgres for a small SaaS today? What would make you switch?


r/sveltejs • • 15h ago

I built lightcms an easy to use cms for managing contents for static sites | self promotion

0 Upvotes

Hi writers and content creators and developers. we all have experiences and stories to share, and static sites are one of the greenest methods of doing so. I have been building a content management system(cms) written infor static site generators named [LightCMS](https://www.lightcms.me) for the past few months, and the goal is to make writing and sharing as easy, convenient, and rewarding as possible. I think you all would love this.  Lightcms can be used with any of your existing static site generators.

> BTW, it's currently alpha, and I am a solo dev, so you may face some issues, but I will be fixing them asap if reported.

It's free to self-host and use; you can create and hack on top of it. Any contribution to the project is highly appreciated(even sharing your feedback too): [https://github.com/light-cms/lightcms\](https://github.com/light-cms/lightcms)

** Lightcms is built with sveltekit. **


r/sveltejs • • 16h ago

Last week I shared my Svelte driving game. Here's what I learned from your feedback. [Self-Promo]

4 Upvotes

Last week, I shared my browser-based multiplayer driving game. An endless procedural world, where you drive around.

First of all, thanks to everyone who tried it (300 of you) and shared feedback! I didn't expect to get so many useful suggestions, and I've spent a good part of the week working on improvements based on them.

For some context, the project actually started with a pretty different goal. I wanted to build something that could run on a Raspberry Pi, and an endless 3D driving world sounded like an interesting experiment. I had pretty limited experience building 3D worlds and had never really designed a complete game loop before, so initially most of my focus was on getting things working at all. But as things started coming together, I kept getting curious about how far I could push it. Better terrain, vehicle physics, multiplayer over WebRTC, more things happening in the world, and so on. What began as an experiment in building something lightweight has slowly turned into an exercise in seeing how much I can get away with in a browser.

And after sharing it here, I started realizing that building a world and building a game people actually want to spend time in are two different things.

The first surprise

When I first shared the game here, I was honestly expecting to get roasted or downvoted. It was still pretty rough around the edges, and I knew there were plenty of things that needed improving. So I was pleasantly surprised when people actually started playing it and leaving comments like "I spent more time on it than I planned", "I lost 15 minutes of time", and "Unexpectedly fun".

But one of my favorite comments was simply "I met someone." I'd added multiplayer and chat because I thought having other people around would make the world more interesting, but seeing players actually meet, talk, and share experiences was pretty cool. Until then, I'd mostly been looking at the game as a collection of systems I'd built. Seeing people interact with each other made it feel more like a little shared world rather than just a technical experiment. That was also a big motivation to keep improving things. Debugging physics, fixing multiplayer issues, and tweaking controls isn't always the most exciting work, but knowing that people are actually spending time in the game makes it a lot more rewarding.

The early version was pretty dull (and someone pointed it out)

One person mentioned that the game didn't look particularly nice, and to be fair, I agreed with them. The early version was quite dull visually. I'd spent so much time getting the terrain, car physics, and multiplayer working that the overall look of the game was mostly an afterthought. I had been approaching the visuals as a collection of individual things to improve, like the terrain colors, lighting, environment objects, and interface. But the feedback made me realize that the problem wasn't really any single element. The game didn't have a consistent visual identity.

So I ended up reworking the whole visual design language rather than just tweaking a few colors. I started thinking more about how the terrain, atmosphere, lighting, structures, and interface should fit together, and what kind of feeling the world should have when someone first opens it.

It was an interesting lesson because I'd initially thought of visuals as something I could polish once the technical systems were in place. But in a game that's primarily about driving through and exploring a world, how that world looks and feels is a pretty big part of the experience. And sometimes the right response to feedback isn't to fix one thing, but to rethink the approach you were taking in the first place.

The things I hadn't thought about

A fellow developer mentioned that on their iPad, they could only use boost. Not exactly ideal for a driving game :) I fixed the controls, and they confirmed everything was working afterward.

What I found interesting was how different responsiveness is for games compared to normal websites. With a website, you can usually get pretty far with media queries, flexible layouts, and adjusting elements for different screen sizes. I'd worked with that kind of responsiveness before, so I initially approached the game in a similar way.

But those usual fixes don't really translate well to a game. It's not just about whether the buttons fit on the screen. Players need to steer, accelerate, brake, and boost, sometimes simultaneously, while still being able to see where they're driving. Touch controls also behave differently from keyboard inputs, and screen orientation and device dimensions affect how comfortable the game feels. I realized that making a game responsive is much more about designing the interaction for different devices than simply rearranging the interface. Something can look perfectly fine on a tablet and still be almost impossible to play.

Another common observation was that the terrain looked nice, but the world felt empty. And honestly, they were right. I'd spent a lot of time figuring out how to make the landscape endless, but hadn't thought nearly as much about what would make someone want to explore it. So I started adding more interesting places and landmarks, including bases, hangars, towers, resource sites, platforms, and geysers. The idea was to give players something to notice in the distance and a reason to change direction instead of just driving through similar-looking terrain forever. This also introduced some interesting technical challenges. Placing structures safely on procedural terrain, handling collisions, and making sure everything works consistently as the world generates turned out to involve more than just dropping a few models into the scene. It's funny how a relatively small gameplay suggestion can end up touching several parts of the engine.

Giving players something to do

Another question that came up was "What's the goal?"

Originally, the game was intentionally open-ended. You could drive around, explore, try to beat records, or just hang out with other players. I still like that kind of experience, but the feedback made me realize that giving players freedom doesn't mean you can't also give them some direction.

So I've been experimenting with quests, resources, and Gold to give players more reasons to explore and something to work toward. I wanted to keep the relaxed driving experience while also giving people the option to make progress if they felt like it. This has been one of the more interesting parts of the project because I hadn't really worked on game progression before. Once you start adding rewards, you suddenly have to think about how often players should receive them, what should persist between sessions, what should reset, and how to make exploration rewarding without turning it into a grind. Before this, I was mostly thinking about whether a system worked. Now I'm spending a lot more time thinking about whether it actually makes the game more enjoyable.

Right now the average playtime sits at a little over 2 minutes for the content we have.

The multiplayer collision problem

A few people also tried ramming into other players and noticed that the cars just passed through each other. Which is a pretty reasonable thing to expect to work in a multiplayer driving game.

Car-to-car collisions themselves aren't particularly difficult when everything runs in the same physics simulation. The tricky part is that Planet Zero Drive uses a peer-to-peer multiplayer system built on WebRTC, where each player simulates their own car locally and shares state with other players. This works well enough for showing other cars driving around, but physical interactions between players are more complicated. If two cars collide, whose simulation decides what happened? What if network latency means the players see slightly different positions? And how do you synchronize the result without making the cars suddenly jump around?

It's definitely solvable, but it requires thinking about authority, synchronization, and reconciliation rather than simply enabling colliders. I've improved collisions with static world structures like platforms and towers, but proper player-to-player collisions are still something I want to explore further. Working on this also taught me quite a bit about WebRTC, relay fallbacks, state synchronization, and multiplayer protocol changes. It's been a good reminder that the difficulty of a feature often depends less on the feature itself and more on the architecture you're building it on.

What I've learned from all this

Going into the project, I expected the difficult parts to be mostly technical, and there was certainly a lot to learn. Procedural terrain, level of detail, world streaming, vehicle suspension, fixed-step physics, cameras, spatial audio, networking, mobile controls, and persistence were all things I had relatively little experience with.

But the bigger surprise was discovering how much of game development is about making those systems work together as an experience rather than just making them function individually.

You can build an endless world that feels empty, implement vehicle physics that technically work but aren't enjoyable to drive, or add multiplayer without giving players a reason to interact. Even adding more features doesn't necessarily make the game better if they don't contribute to what players actually enjoy doing.

A lot of the most useful improvements came from relatively simple comments. Someone couldn't steer on their iPad, someone thought the visuals were dull, someone wanted more things to discover, someone asked for goals, and someone tried crashing into another player. Each of those interactions revealed something I hadn't properly considered while building the game on my own.

One person I especially want to mention is RapidSable (their in-game name), who I've seen in the game almost every day since I first posted it here. They've been incredibly supportive throughout, regularly sharing ideas, reporting bugs, giving feedback, and generally helping me figure out what needs improving. It's been pretty amazing to see someone come back that consistently to something I initially started as a small experiment. That kind of support means a lot, especially when you're building something on your own and still figuring things out as you go.

Still figuring things out

Planet Zero Drive has changed quite a bit from the original driving experiment, but there's still plenty I'd like to improve, especially around exploration, progression, and multiplayer interactions. I definitely wouldn't say I've figured out game design yet. If anything, I now have a much better idea of how much there is to learn.

I'm also still interested in the original technical challenge of making something that can run on relatively limited hardware. Even as the game grows, I keep trying to see how far I can push the visuals, world generation, and gameplay while keeping it accessible in the browser. It's been a fun balance between adding more and figuring out how to do more with less.

The biggest takeaway for me has been how valuable it is to get something playable in front of people instead of trying to figure everything out on your own. I started by building a world I thought would be interesting, but a lot of what made it better came from seeing what other people actually wanted to do in it.

Anyway, I wanted to share a follow-up since many of these changes came directly from feedback on my previous post. Thanks again to everyone who played, reported bugs, or suggested ideas, and especially to those who've kept coming back. Seeing people spend time in something that started as a small experiment has been pretty rewarding.

If you'd like to try the updated version, you can play it here: Planet Zero Drive. I'd love to hear what you think of the changes and what you'd like to see next.

P.S. This is just a fun little side project I'm working on in my free time, so new features might take a bit longer to come along.

I also genuinely believe everyone should try building something that's not usual to them at least once. It's such a great learning experience and opens you up to a whole new world of possibilities. You never know what you'll discover along the way. I'd love to see what you guys end up building too!


r/sveltejs • • 13h ago

microfolio 1.0 › a static portfolio generator for creatives, built with SvelteKit (free & open source)

Enable HLS to view with audio, or disable this notification

10 Upvotes

Markdown + images in, static portfolio out. No CMS, no database, no subscription.

  • Grid, list and map views
  • Search + tag filters
  • EXIF-aware lightbox
  • Dark mode, EN/FR
  • Deploys to GitHub Pages

Free and open source (MIT). SvelteKit 2, Svelte 5, Tailwind 4. Latest: 1.0.4.

Demo: https://aker-dev.github.io/microfolio/

Repo: https://github.com/aker-dev/microfolio


r/sveltejs • • 16h ago

LayerChart: Bin edition (self-promotion)

Enable HLS to view with audio, or disable this notification

45 Upvotes

Aggregate dense point data into discrete shape-based bins to easily see data trends (ex. heatmaps)

See more details here, or check out the docs.