rustasync / team

A point of coordination for all things Rust and Async
https://rustasync.github.io/team/
MIT License
224 stars 29 forks source link

Call For Example Web Projects #44

Closed yoshuawuyts closed 5 years ago

yoshuawuyts commented 6 years ago

As part of the Net::Web WG we want to help people find their way around Web programming in Rust (#37). One part of this story will be by sending out surveys (#27, #40). But another thing we want to do is create a collection of examples for common tasks in web programming.

We think that gathering a collection of documented example projects can help us with a few things:

What does an example program look like?

An example program should have the following things:

And that's about it I think. I don't think we'd need to have many other restrictions in place, as our purpose is to explore the different ways that people solve web-related tasks in Rust.

What kind of examples are you looking for?

The goal is to have small examples that generally cover a single task. Examples would include:

But these are just some example. We'd love to gather more! So if you have some good ideas go ahead and comment below!

Where should we link these examples from?

Let's link them from this issue for now, but if we get enough examples we should probably make a dedicated repo / link it from other web resources. But I propose we do those things as they're rolled out, and instead place an initial focus on creating content.

How is this different from the Rust Cookbook?

The Rust Cookbook is a resource that helps show how to perform a variety of tasks in a wide range of domains using code snippets.

The goal of the example projects is to show off how to do common tasks in the web domain using complete projects.

How can I get involved?

We'd love to have people both contribute ideas for common web tasks, and implementations of projects!

If you have ideas that would be worth exploring, please comment in this thread. Similarly, if you've implemented a task, feel free to link to it from this too.

Please include a description of the task your project solves, and any notable architecture decision.


Hope this all makes sense. We're happy answer any questions people have, and update this post to help clarify things.

Happy hacking!

mattdark commented 6 years ago

Hi

I don't know if this is what you're looking for. I've been working on a presentation manager for reveal.js. I wrote about it here: https://medium.com/@mattdark/presentation-manager-written-in-rustlang-f36b73bb8dd2 and the repository is here: https://github.com/mattdark/presentation-manager-rs

I will update the README on weekend

Vrixyz commented 6 years ago

Hi,

I have my own “open ID” interpretation available here : https://gitlab.com/Vrixyz/oauth-server.

The Readme has some details, I would be happy to answer questions about it, and continue (slowly) its development.

Be warned: it’s highly unpolished, WIP and NOT production ready.

vishusandy commented 6 years ago

I have been working on a blog in Rust and Rocket, the repo is at https://github.com/vishusandy/blogr I have the app running at https://vishus.net which also contains a few tutorials/guides on web development and hosting a when app in Rust https://vishus.net/content/tutorials

yoshuawuyts commented 6 years ago

Ohhh, the contributions so far are really useful! If I could be so free, a thing that would be very helpful would be to hear more about the process. What was hard to do? What was easy to do? The more we know about what you ran into, the more it'll help us.

I've spent the afternoon implementing a small program for signup / login using Argon2 + Hyper. I figured it might be useful to share:


Project: secure signup / login

Repository

Design

I had the idea of building a quick login / signup API using two endpoints: /login and /signup. To be compatible with vanilla HTML, all data is taken from querystrings. To reduce the amount of implementation surface usgin Arc<Mutex<HashMap>> as the database should be enough.

To make it as realistic as possible we should use the argon2 hash algorithm which can also defend from GPU accelerated attacks. And the program should run asynchronously over cpu_num threads, with a friendly CLI frontend.

Crates Used

Notes

Vrixyz commented 6 years ago

Thanks for he example of feedback, I started an issue on my project to attempt to help you : https://gitlab.com/Vrixyz/oauth-server/issues/6

As project might be numerous here, and discussion difficult to follow, If you have specific questions on my project, ask them on that issue, and for anything more generic, this thread will be the place.

KodrAus commented 6 years ago

I spent some time last year looking at ways to structure a web app in Rust, independently of specific web frameworks. The result is here. Unfortunately I haven't found a lot of time this year to keep it up to date, but would like to.

shmolyneaux commented 6 years ago

Create an API around a full-text search engine to search in documents

This piqued my interest. I don't have much practical experience with web development or Rust, but I thought I would contribute something and learn along the way. You can find my (very work-in-progress) implementation here. So far I've created a basic frontend and mocked out a REST query on the server-side. I'm currently using rocket on the server, and I plan on using tantivy for doing the indexing / queries.

I plan on indexing a subset of Project Gutenberg since it's in the public domain and is a moderately-sized corpus.

kaj commented 6 years ago

I wanted to try out warp before possible switching to it in a larger project, so I wrote https://github.com/kaj/warp-diesel-ructe-sample .

This project gives each handler access to a Session object as well as any arguments from the URL parsing, containing a handle to a diesel database pool and a user (if logged in). It also uses ructe for server-side creation of user-facing html pages. Please see project readme for further details.

bIgBV commented 6 years ago

I wanted to better understand tokio and it's surrounding crates so I implemented a client for the Beanstalkd protocol.

Project: tokio-beanstalkd Repository: https://github.com/bIgBV/tokio-beanstalkd

Design

The library is pretty simple in that is uses tokio-codec and implements the Encoder and Decoder traits for a simple codec. The public API is just methods provided by the protocol and internally these methods send a request on the Sink from the codec and read a single response from the Stream and return it back to the caller.

It's still a work in progress, but I'm trying to make a simple to use and easy to understand API to interact with the work queue. The crate is at a state where most operations around jobs are implemented. I'm working on the rest slowly.

Crates Used

Notes