social-protocols / propolis Goto Github PK
View Code? Open in Web Editor NEWEnable useful discussions among thousands of people.
Home Page: https://propolis.fly.dev
Enable useful discussions among thousands of people.
Home Page: https://propolis.fly.dev
Instead of manually invoking ensure_auth
in every GET / POST function, use axums FromRequestParts
trait as in https://www.propelauth.com/post/clean-code-with-rust-and-axum. This way we can get the user struct directly as a parameter to every GET / POST function.
Currently we're using the default, which means it's a session cookie. It has a very short expiration time.
Example usage:
curl -v -H 'Authorization: Bearer jc7HxwGvkXd7RDij' -H 'Content-Type: application/json' --data '"ItDepends"' http://localhost:8000/api/v0/statement/9/vote
There is no create_statement endpoint yet.
https://github.com/rust-lang/rust-clippy
When a statement is polarizing it requires arguments, more context or more specific alternatives. If people really disagree on something, it's time to add arguments.
Good arguments are specifically required from the minority, because they might be the ones who are right.
On the other hand, the minority might be wrong and needs good arguments to be convinced of the truth.
The system automatically asks users who already voted on a statement to provide an argument to support their answer.
In that case, the statement page also shows a text field to add an argument as a new statement.
Pressing any of the voting buttons simply renders the next statement instead of redirecting. This causes a refresh to ask for a retransmission of the POST request, which really does not make any sense
There are many possibilities:
Two users might add statements which have exactly the same meaning. This can easily happen when adding arguments.
It can also happen across different languages.
Those redundant statements should be proposed to be merged into one. We can ask targeted users if two statements say the same. Once we have enough votes to be certain, they will be merged. All their connected metadata will be merged, too.
What should happen when they are just very similar?
What should happen when one statement is the negation of another statement?
There are several ways to detect redundant statements:
sqlite3 --init /dev/null data/data.sqlite "select name from sqlite_master where type = 'trigger'" | while read -r trigger; do echo "dropping trigger \"$trigger\""; sqlite3 --init /dev/null data/data.sqlite "drop trigger \"$trigger\""; done
Like in a normal discussion, when participants disagree, questions come up to test why they disagree.
We can support this mechanism at scale by letting users send follow-up questions to users who provided a specific answer to a specific statement.
When creating a statement
Reproduction:
Type foo.
or foo-bar
into a search field.
I'm not entirely sold on doing things the old-school way. Maybe evaluate some of the options out there?
In particular, I dislike:
Opinions?
Tasks
Maybe just cache them for one week?
When a question is too generic to answer or when a statement can be interpreted in different ways, the answer is often: "It depends"
Clicking on "it depends":
The account page shows the secret and lets one log in with another valid secret (set the cookie). Valid secrets are only generated by the server.
There should also be an easy way to log in on other devices, for example using a QR code. Or sharing a login-link.
Consider this statement:
The process for legal immigration is too complicated and needs to be reformed.
As a german I might be: I agree
As a canadian I might be: I disagree
If I only care about the responses from a particular country, how would I go about finding those? Should there be additional statements such as: I am from country XYZ that should go along with the above statement? If yes, how can we ensure our target audience actually gets those asked?
Or would we instead consider the first statement to be not specific enough and instead suggest rewriting it to:
The process for legal immigration in the USA is too complicated and needs to be reformed.
Currently we're loading fonts from google fonts. But this slows down the site with unnecessary requests.
Options:
https://docs.rs/axum/latest/axum/error_handling/index.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.