[-] echodrift@programming.dev 2 points 1 week ago

That’s an interesting perspective. I am pretty paranoid and I run the backend API in docker from a non-root user. I am pretty paranoid but kinda clueless doing all of this myself, I did use an ssh key that requires a yubikey to login to the VPS and I don’t store any secrets on the VPS it‘s all managed via GitLab.

I’m just getting started, so there’s not even a DB currently, not yet needed. I would want to run everything over k8s eventually, and was considering hosting gitlab myself for the experience and because I can’t afford paying for the CI/CD stuff.

Does it make sense to run everything on a separate instance from a security perspective? I’m already having nightmares from thinking about the networking between all of that :D

[-] echodrift@programming.dev 2 points 1 week ago

Thanks, this is reassuring. Yeah I don’t really know what I’m doing with the headers but trying my best to be as restrictive as possible. I think I’m still doing something wrong with the headers because I can’t seem to connect to the backend when the fronting is deployed.

Yeah I’m super paranoid about what I’m exposing, I made sure that there are no environment variables or secrets exposed.

35

So basically I built a backend with some working endpoint and I built a React Frontend. I can run both things locally and I hosted the page on Cloudflare pages which is working. But now I’m wondering if that’s a good idea?

I have never done this before and I’m wondering if it’s secure enough to host the backend on some server and allow a CORS header to let the Frontend generate requests?

The alternative would be to host Frontend and backend on a VPS and then route my domain that I bought on Cloudflare there, but then I’m thinking that in case my Frontend is insecure somehow the whole instance would be compromised, no?

I hope this is the right platform to ask as I’m pretty new here.

[-] echodrift@programming.dev 2 points 2 weeks ago

Thanks! This is something I had no idea could be an issue. I just started standing up all the dummy functions for the different layers so I’ll take a step back now and review the resources you pointed me at. Also, in the Poem docs I don’t see them using async functions either. I’m very glad I asked.

[-] echodrift@programming.dev 1 points 2 weeks ago

Thanks a lot! Yeah I’ve been doing that and the compile messages are honestly awesome, sometimes I’m not sure if I should react to every warning because it’s a lot of extra work during development, but it helps me understand what’s going on. I’m still puzzled about some of the details of the language but the community seems very nice and there seem to be a lot of resources. Thanks for the encouragement!

[-] echodrift@programming.dev 1 points 2 weeks ago

Honestly I have no idea wtf that is and luckily I don’t see that when I open the page! Seriously wtf

[-] echodrift@programming.dev 2 points 2 weeks ago

Thanks! One of the reasons for choosing Rust was actually concurrency. So I’m building a bunch of endpoints that connect with some microservices and I expect to have many simultaneous requests. I’m honestly not like super senior but for the Python backends we’ve been building we always made everything asynchronous so I kinda got the impression that that would be necessary for my use cases. Should I also be careful with async functions when using Poem?

[-] echodrift@programming.dev 3 points 2 weeks ago

Thanks! This seems exactly what I'm looking for

[-] echodrift@programming.dev 4 points 2 weeks ago

I would love to! But with the time I have at hand I won't be starting a project in the next 2 years if I try to finish the book first. I started coding with Java, then did a lot of Python & TypeScript and now I'm here. I'm mostly building CRUD apps nothing fancy, any idea which chapters of the book I could prioritize to make sure I'm not missing anything that would lead me to making really bad, hard to refactor decisions?

14

Hey all! Read a lot of good things about Rust and I was getting pretty bored and often annoyed with building new FastAPI apps. I'm just getting started, from my research Poem seems to be doing the same thing as FastAPI kinda and I'm using SeaORM for the DB.

So far I'm loving it, Cargo.toml looks a lot like Poetry in Python but in VSCode it magically shows me the latest versions of all dependencies. Debugging is really nice because I can just copy & paste compiler messages into an LLM or Google them. It was a bit of a hassle to get all dependencies to work together and to get the thing to compile at first but now it works and I'm happy.

That being said is there anything else I need to know? I still have a very limited understanding of the whole ownership thing but e.g. I understand the benefits of passing variables instead of copying them so I guess that's a start?

echodrift

joined 2 weeks ago