Hi, thanks for listening. This is the It's All Widgets Flutter podcast. My name is Kolo Korn. In each episode, you get a chance to speak with an amazing member of the Flutter community. This episode, we're really lucky to be speaking with Victor, the founder of ServerPod. Welcome. Thank you. I'm very happy to be here. Thanks for being on. So to start, can you share a bit about your background? Right. So I've been a developer for a long time. I actually started coding when I was probably 12.
um my parents computer wanted to do computer games and i actually worked in the game industry for a quite a long time and that took me i'm from sweden but it took me to san francisco and filicum valley so i ended up moving there i was recruited by a big game company in san francisco worked there for a while and then i got an offer from a
startup over there so i ended moving there so what i i built a tool basically for doing computer games or mobile games primarily and so so this startup all the clients were using my tool to build the games and yeah that was a pretty amazing time unfortunately they ran out of money like startups sometimes do and then they sued me to google where i ended up on the fluttertee
so I actually worked on Flutter very early on there and yeah and then it was great working for Google and all but I think it's probably in my genes that I have to have a look at my own project so I ended up moving back to Sweden so I live in Stockholm now I run the startup here for a couple of years and I
Obviously, I used Flutter for building the app, but I really missed having a good backend for it. So that's sort of the start of ServerPod, where the idea was born. So that's what I've spent the last 18 months doing now. Yeah, so that was a very quick intro to my background. Awesome. And that brings us right to ServerPod. Do you want to take a second to explain what it is and why people would want to use it?
Yeah, so I'm a fatter developer like I guess most of the listeners to your podcast. And I really felt like I was missing having a good backend for it. For the type of app we were building, it wasn't really possible to use Firebase. So I started looking at different options and tried out some and wasn't really anything I liked that much.
And one big thing is that you will end up using two computer languages, which I find a little bit distracting when you're working. And Dart is such a nice language. So I just decided to take the time to build ServerPod, which is a backend specifically built for Flutter. But it's also using Dart for the full stack. So that makes it possible to...
You start as a single language. And we added some really cool innovations to ServerPod. It will actually analyze your server code and find your backend methods and replicates those on the client side. So when you call a method in ServerPod, it's just like calling a local method in the app, which is pretty cool.
And we built a really good serialization layer. So it's actually using a very standardized REST API. You just don't have to see it when you work with ServerPod, which is pretty nice. So you can just forget writing all that code. And we made a great ORM for it. So it's very easy to pull an object from the database. You can actually pull an object. You can post it straight to the client. If you need to strip out
Certain fields that can be sensitive, it will do that for you. And we built everything around it, like setting up the infrastructure with Terraform, doing file uploads, authentication, all these things that you typically need when you're building an app. We just got it built in. So when you set up your server pod, maybe you won't think about those things when you start building.
hacking away, but it will save you lots and lots of time in the long run to just have that ready for you. And that includes stuff like we build really good caching, really good logging. We actually have a graphical user interface for reading the logs, which is really, really nice. Yeah, so that's day six of ServerPod, I guess.
Amazing. I'll give you my frame of reference. The app we're working on, we use Flutter for the front end and for the back end we're using Laravel, but we spend so much of our time writing that glue code. We're using a REST API to connect the front end and the back end. And for example, just keeping the models in sync itself is a challenge. But beyond that, then there's also just simply serializing the data and passing it back and forth. And it sounds like Cipherbot just eliminates all of it, where you just make a request on the client and it's actually calling the back end code behind the scenes.
which is amazing. Yeah, I mean, that's a lot of, that's very common feedback I get from developers that use, especially, you know, different, a different backend
that's written in a different language, you really need to do all that translation code to decode your objects, making the APIs, and just having all that made for you. And, you know, ServerPod makes sure it's all kept in sync. It's really easy to keep it backwards compatible, which is also important because, you know, apps, there's a little bit of a cycle when you update something
When you release an update, it can take a long time for people to get the new updates. So it's really important to be able to keep that backwards compatibility, but also keep everything in sync. And with ServerPod, that's just something you don't really have to worry about. It just works. Very cool. As far as hosting a ServerPod application, is there a recommended platform? Is it AWS or can any Dart server work?
I mean, you can basically host it anywhere where you can run Dart. You will need to have a Postgres database that's connected to it. That's sort of the only requirement. And Dart runs pretty much anywhere at native performance. So that's not really a problem. We have written Terraform scripts for AWS that will set up your complete infrastructure. So that's, you know, with...
autoscaling, load balancers, buckets for uploading files, deployments from GitHub, like the whole shebang. And it literally takes you 10 to 15 minutes to set everything up with all domain certificates, everything. Right now, we're also working on... And that's actually the feature I'm working on right now is...
making the same experience for Google Cloud. So you basically have two really good options, but you can host it anywhere if you want to do all that setup yourself. But I think that would be a really nice addition and something that a lot of people have asked for.
I absolutely agree. I'd say the one thing that sells me the most on the project is when I look at the success of Node. I've done a lot of JavaScript programming. It has its quirks or challenges, but Node is so incredibly popular, even though it's using JavaScript, I think largely because you're able to share one language at the front end of the backend. So I think if you take that paradigm and you move it to Dart, where you have really a great language, to be able to build Flutter on the front end for your UI and then Dart on the backend just seems to make apparently so much sense.
Yeah, and Dart as a language is... I mean, I guess it's not primarily built for the backend, but it works super well on the backend, so...
I'd say it's a great choice. The only thing today I would say is that it's not quite as mature as what you would have with Node.js, right? You can find a lot of examples and code, and the Dart just hasn't been along for the backend as long. So there's a little bit more of a journey there for it. But for all sort of standard stuff,
it's there um you can get like the whole google apis in dart for instance um with nice nice apis um and serverpod just supports that out of the box so you can basically set up authentication with google and then you can access all the apis server side which is actually pretty tricky to do without serverpod it was a lot of work to to to make all that um
And ServicePod is really built from the requirements of an app developer and all the stuff you need when you build an app and stuff that you don't necessarily think immediately that you will need. I think a great example for that is caching, where it's often an afterthought. You add it when...
When you realize things are getting too slow. And just having that built into the server is really, really convenient. Because it makes it so easy to add those things when you need them. And also finding errors. So we built a really cool logging system for ServerPod. So say...
You have a method that's a little bit slow to execute. You can actually turn on logging to show all the slow method calls. And when you find them, you can change the setting for that specific method to up the logging levels. You log everything that happens, including all database calls. And that's a very common cause for things being slow. And you can basically...
see every query that you made, how long time it took. And the query is actually saved with a stack trace in Dart. So you can just click the stack trace and it will take you straight back to your code. So that, I think, is a really neat feature that will save people a lot of time. I don't know if you've tried to dig into database logs and find slow queries, but it can be pretty tiresome.
Absolutely. And can you define things like indices in the model definition? How would that work? Yeah, definitely. So that's also something we'll be working on for the next big update for ServerPod. And that's
I mean, it already does indexing and it will generate the database tables for you, but it does not yet handle database migrations. So that's definitely something we're going to add in the future and make that process much, much smoother. So that will include indices, obviously, although there are all of the support for it, but
being able to add that in your definition files and just have it affected on the server would be super nice. One area we struggle with a lot in our app is the relationships between models. So it's easy to load one record, but the record could have a one-to-one, one-to-many, many-to-many relationship. Is that handled in things like Euroloading, lazy loading? To some extent, I would say, but there's still some work to be done there to make that better. And
You can always use any SQL code if we don't have support for it in the ORM. So there's really no limitations to what you can do, but it would be really nice to be able to do lazy loading and things like that and have that out of the box. So would you say it's fair to compare it to something like Firebase or Superbase, except it's dark on the back end as well? Yeah, I would say compared to Firebase, it's...
It's a little bit different approach to how the server is set up. So it's actually, the server can have a state in ServerPod, which makes it possible to build whole other sort of kind of applications that are really hard to do with Firebase, I would say. Like if you do real-time communication, it could be a game, but even if you do
things that need to be pushed a bit more data back and forth and you don't want that to go through a database then serverpod is an ideal option so we made a simple example app called pixorama.live that I would recommend people to check out it's basically a multi multi-user drawing experience where anyone can draw pixels on a grid and you can do it at the same time
simultaneously. So it's a pretty fun little project, but it's very, very easy to do things like that with ServerPod. And that whole backend is less than one page of code. I don't know if you checked it out before, but I would recommend people to go check that out. It's at pixorama.live. You can open it just in your browser. It works with Flutter Web, obviously. It works on
in the device. Amazing. And is it just you at the company or are there other people on the team? And also I'm curious if people want to add features, can people contribute? Yeah, so I'll start with your second question there. And yes, people, it's all open source. So we've already got a lot of contributions from the community, some really big ones and
Some cool features, one that is going to make it to the next version is, I think that is such a clever feature. So basically, it allows you to throw an exception on the server and catch it on the client. So it'll actually serialize the exception and...
pass it over to the client, unpack it, and through the same exception. Obviously, this won't happen with every exception, but you can make special exceptions that extend to a specific class that will have that behavior. And that just opens up for a new way of doing error handling that is very convenient, actually, as it turns out. So you can pass error messages back. You know, exceptions can be very convenient in many places.
in your app code but now you get that whole experience all the way from the server to the client. So that's a really cool contribution that came from the community and someone just made. As for the team, I actually raised money for server pods before the holiday so I'm putting together a team so I'm hoping to have that soon.
um yeah in the next few months i have some really cool people that seem to be interested so uh we'll soon have a team but right now it's me and i guess the investors are helping out too quite a bit so that's amazing congratulations and good luck that's super exciting thank you yeah yeah it's it is very exciting and uh uh also a little bit
So I don't think, you know, you need to really get the right persons in early when you're just a few people. But so far I've done all the coding myself, except from the contributions, which, yeah, some are pretty substantial actually. So I would say there are a few people that are actually working on server pod.
If you're interested in helping, they probably also can write tutorials or examples, documentation, blogs. Besides writing code, just building out the ecosystem I'm sure is helpful as well. Yeah, definitely something that we need help with. And there's already some YouTubers who made tutorial videos around ServerPod. And there are some tutorials I know in the works.
So there's definitely more coming, and I know the documentation can be fleshed out a little bit in areas. But it's... I mean, it improves every week, so there's a lot of happening. I actually released ServerPod, I guess it's maybe three weeks ago now, but yeah, the response has been quite something since. So much interest, and...
so many more contributions and people helping out so it's really a buzzing community around it which is amazing but also it's super challenging keeping on top of everything a happy problem right yeah yeah cool and what's the website serverpod.dev and from there you can obviously find github and that's where you can also find the
and discussion boards and that stuff. At some point, we're probably going to do a Discord or Slack server too, but for now, it's just everything is basically on GitHub. So, Mr. Speaking, I'm curious to get your thoughts on Flutter in general. For example, when you build Flutter apps, a common question we get asked is what a state management approach to use. And do you use a specific package or do you inherit a widget? Right. So, I mean...
Recently, I've used RiverPod most. I think that works really well. I've also done just, you know, get state. It depends a little bit on the use case. I would say if you write like a widget that's reusable, I think just using set state is probably the way to go. For my own projects, I use RiverPod.
But, yeah, I don't really have a strong preference. Just to be the thing that most people use, so that's why I picked it. You know, I'm happy with it. And I'm sure with server-powered, you can use any approach. It wouldn't matter. It's just Dart code. Yeah, yeah. Yeah. Exactly. Is there any advice you'd give someone just starting out? Good question. Um...
I think maybe start with a couple of smaller projects and get those done if you're learning and maybe not start with a project like, say, ServerPod. It's very helpful to have done a couple of projects before that. And also, I think it can be really useful to do some smaller apps just to...
build out your resume if you're looking for flatter jobs, for instance. I know I definitely look at when hiring what people have done before and if they have something to show and if they have code to show, that should be useful. So that's definitely some advice I would give to someone who's starting out if you want to sort of become a professional flatter developer. It's really good to build a good portfolio that you can show
I think that's almost or maybe more important than having a strong background in computer science or something like that. Although it depends a little on the job rights. That can be very useful too. I certainly had a lot of use from my degree and what I learned there. It's a good suggestion. I agree. I think these days your GitHub profile matters a lot more than it used to.
For better or worse. Yeah, yeah, definitely. And I mean, one way it can be to contribute to open source projects like SilverPod or there are many, many options for that. And that can be a great way to learn and also, you know, get feedback on the code you write. Because I think for most open source projects, you have a code review before everything.
So we'll merge it into your project. So just getting that feedback can be very, very helpful. I think that was probably my biggest learning from working at Google, that code reviews are so hard. I probably spent more time getting my code through the reviews than I spent writing the code, making everyone on the team happy with what you've done. So I think for most projects, you don't need...
Cool, that is that perfect. But in an open source framework, it can be very important, right? That there are tests and the code is stable and everything works.
Absolutely. Now, as a programmer, I think very often you can program a lot by yourself, but it's really when you start to program as part of a team that you learn to become a programmer. I didn't really learn to be a musician until I played in a band, right? You can stay at home, play guitar as much as you want by yourself and get really good, but until you learn the challenges of interacting with a team of musicians, group of musicians in a band setting, that's when you really kind of master your craft. I think programming is the same, as you mentioned, and pull requests and code reviews and understand that process to become really an effective programmer. Yeah, I mean, definitely, yeah,
A big difference. When I learned programming, I mean, this was...
Pretty much before internet. So you had to go to the bookstore and bought a book on C programming. I had pneumonia for like three weeks and I spent that time reading computer programming books, learning to program C. I was so sick I didn't really leave the bed. So I just read the book. I didn't even have a computer to try it out on.
That's how I learned programming. But the code you write, I mean, I learned so much from that book. And then I eventually, obviously, got a little bit better and I started programming in front of the computer. But there was certain aspects of programming it did not have in that book. I mean, it had everything like, this is how you write the C program, right?
But it didn't have the part where like, this is how you structure your program. So I basically wrote like the whole program in one file. It didn't teach you how to do header fires. I mean, that's something you don't really use anymore, I guess, for most programming languages nowadays. But yeah.
back in the days there was a requirement for being able to share code between files and I just couldn't teach that so I didn't know. Yeah, so I guess it was first when I started programming or like studying computer science and had some classes they really forced you to structure your code and those parts and I think
I guess that's like me being a bit of a solo guy, just writing coding in a huge single file, right? And when you start working with other people or getting reviewed by other people, they're like, oh, what are you doing? I imagine. So I guess, I mean, it's a very easy to just go in your...
like same tracks yeah and um it really it's really really helpful to get that feedback from other developers for sure absolutely cool is there anything else you'd like to promote all right um i don't i don't think i have anything to promote but other than serverpod so go check that out uh it's at serverpod.dev and i'm
Yeah, I mean, we love all the feedback we can get from it, so give it a spin. Tell us what you think. And yeah, help us spread the word. It's something I hope really will help a lot of other developers. And yeah, I'm super excited about the project. You know, what drives me is really building something and see people use it. And
you know, so cool to see the apps that people are building with your tools. I just love that. So that's my main driving force. So if you want to support me and make me happy, go check out Serverbot, I guess. Victor, thank you so much again for being on the podcast and thank you for listening. Until next time. Bye. Thank you. Thanks for having me. My pleasure.