Hey people, do you know a good repo for reference ...
# ktor
c
Hey people, do you know a good repo for reference on building your first backend? And where do you guys usually host for testing?
c
I know the docs, that’s definitely a go-to solution but I was looking for a GitHub repo. I’m trying to find a better way to bring non technical people closer to Kotlin and building things.
e
The docs have examples in Github. Are you looking for more full-featured repos?
c
Yea, I wanted something that would guide you including databases, spinning it into a server (something simple). Right now the way I know how to do it involves Amazon and I do not believe it feels user friendly. I’m starting a new meetup called Digital Builders where I will help people create digital products from scratch. KMP, Ktor and all. The problem is that the last easy thing I used was Heroku and they sort of ended that, and I was looking for other opinions.
(Ended the being simple thing)
But I appreciate any tips, I knew I would need to build it from scratch and do the whole research anyway and there wouldn’t be any material that could help me onboard curious, beginner and mid level people
i built my backend based on the last one i’ve sent you, but it took some time to figure some things out, i have 1.2M records in my DB which is not so big, ktor is really easy and a lot of the documentation is already there to help you even in the most complex use-cases and even if there’s not, some of the things are pretty simple and most software engineers should know the patterns like repository service etc… which are still being used today to make ur backend testable and scalable, how far are you willing to go and what approach you might take, is a different journey, IMO you should pick what works best for your team/company and what tools they know already, you can always see how some things are done in SpringBoot and come back to implement it in Ktor my stack is: • ktor for the whole KMP with common serialization for the pojos • jooq + postgresql + flyway + hikari for the backend database • SQLDelight for the other KMP targets • Compose for shared UI (desktop, mobile, webassembly) • slf4j for logging on the backend, napier. for the rest • bcrypt for passwords • jwt for auth endpoints with simple caching from ktor (might utilize redis in the future but so far so good) with resilience4j circuit breaker and ktor’s rate limiter • test containers for the db tests • prometheus exposed only locally to a caddy rp that utilizes loki and promtail to feed the logs to a public grafana server (might add authelia to the mix for better security, sign up disabled for start) to create the graphs i need for monitoring also ktor has an easy and also nice prometheus scraping api • all of the backend dockerized and built through github actions then deployed to a VPS served through a subdomain, with redirects handled by caddy
🤔 1
c
This is a really great insight
This are very good stepping stones for comparison
I just need to come up with a definition of “simple”
The goal is really to teach other people and create a very low entry barrier
I’m gonna be giving a workshop on the subject: https://www.meetup.com/digital-builders/ Most probably end of next month
h
i see you’ve used heroku, ktor offers out of the box deployment to Google, you can also use fly.io, i just decided to go the VPS route because it’s simpler (for me at least) and more cost effective there’s no simple once the backend starts to grow and when more and more traffic is thrown at you But for simple things like an intro, i already gave a local conference talk and here’s the repo https://github.com/InKotlin-mk/KMP-intro
👀 1
c
Thank you and fantastic. I also did my share of KMP. What I’m really worried is the backend. I believe in the end I will have to chose a project, break it down into parts and increase the level of the talks, steadily. Still thinking about the format. But the goal would be that people would come out with something that works and that they can modify.
h
i’m gonna be the guy that suggest a note’s app backend and frontend but another alternative to that can be a simple store (products, categories, filters, search), this is already complex enough but you can start really simple by listing, inserting to db via the backend etc… afterwards you might bring elastic search into the equation but i’ve decided to utilize postgresql’s FTS since i didn’t find a lot of guides for it with Kotlin but as you can see from this discussion, there’s not only one solution to the problem, which one you choose i’m sure you’ll have fun implementing and presenting, as it solves a real problem
c
Yea, but I do like the notes app. I appreciate very simple and concise solutions. Offering something super basic still might be challenging to a lot of people and increasing complexity and bringing new technologies will never be an issue 😂
v
@Cicero I have a half-baked boilerplate project that you could also take a look at. Iirc there is something misconfigured with ios, but shouldn't be too difficult to figure out. https://github.com/Qw4z1/KmpTemplate
👀 1
c
Gold
🙏 1