←back to thread

319 points levkk | 6 comments | | HN request time: 0.62s | source | bottom

Hi everyone,

I've been "funemployed" for a few months and with all that free time and idle hands I wrote a full web framework (think Rails, not Flask) for Rust.

It's boring old MVC, has its own ORM, templates, background jobs, auth, websockets, migrations and more. If you're keen but don't feel like rewriting your app in a different language, Rwf has a WSGI server to run Django (or Flask) inside Rust [1], letting you migrate to Rust at your own pace without disrupting your website.

I think Rust makes a great prototyping and deploy straight to production language. Now it has yet another framework for y'all to play with.

Cheers!

[1] https://levkk.github.io/rwf/migrating-from-python/

Show context
throwaway313373 ◴[] No.41915030[source]
I would kinda expect REST framework to be able to generate Swagger (aka OpenAPI) definitions out of the box. That's one of the killer features of FastAPI in my opinion.

Also, I don't really understand what is the reason for creating your own ORM instead of integrating with, let's say diesel.rs [0] and what is the reason for inventing your own template language instead of just picking one of the most popular existing template engines [1].

Other than that this project looks really interesting and I will definitely keep an eye on it.

[0] https://diesel.rs/

[1] https://crates.io/categories/template-engine

replies(6): >>41915379 #>>41915941 #>>41916052 #>>41916364 #>>41916443 #>>41916690 #
1. fmbb ◴[] No.41915941[source]
Know of any similar frameworks that work the other way around? Where you can Keep an openapi definition as the source of truth and validate that your server follows it, I mean.
replies(5): >>41916004 #>>41916011 #>>41916288 #>>41916614 #>>41917044 #
2. jjnoakes ◴[] No.41916004[source]
You could generate a spec for the service and then diff to the expected perhaps.
3. internetter ◴[] No.41916011[source]
You can simply diff it. Define the OpenAPI spec, have the framework generate a spec, compare.
4. giancarlostoro ◴[] No.41916288[source]
As others suggested, I would diff against a generated one, then potentially treat the generated one as source of truth in the future... Then diff accordingly as it changes.
5. florianmartens ◴[] No.41916614[source]
I agree. API-first is the way! Change your schema, auto-generate types into your code and use them for your server definition. It's just faster and more secure this way. Use api-fiddle.com or spotlight.io to work with the schemas (branching, sync with Github).

In a fully typesafe world, it should be pretty hard to derive from the shema this way.

6. JamesSwift ◴[] No.41917044[source]
Rswag is still my favorite openapi-related project. You write integration tests against the server and get an openapi spec as output. But thats for rails.