Code Monkey home page Code Monkey logo

stacker.news's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stacker.news's Issues

[Feature request] Add ability to edit comments

Title is self-explanatory. Sometimes we make mistakes in comments. Replying to your own comment with the fix is a workaround, but an inelegant one. Perhaps it could use the same system as Reddit does where an edit after a certain period of time indicates that the comment has been edited. Could also see a use for being able to view the original comment to see exactly what was edited if the commenter does not indicate that themselves (such as with a strikethrough through the edited word for a misspelling rather than simply removing the word).

Invite/Referral Program

We want to provide users with more ways to fund their accounts/earn bitcoin. We also want to bootstrap the community because users will get more value from the site if more people are on it. A simple solution is a sat referral program. I'm thinking 20 sats but I don't know.

Search

Many users have asked. Fairly straight forward to throw everything into ElasticSearch given my experience with https://grepmed.com ... but ops can be complicated.

Refresh button or cache invalidation

Responses are cached on the client but invalidate as the browser sees fit. This is nice for the user experience in certain contexts but the main/recent pages tend to go stale too slowly so the user is forced to manually refresh.

I'm not sure the best way to do this from a UX perspective.

Improve Performance

It's easy to discount how much performance affects the UX. SSR is a step in the right direction but because it makes db queries synchronous, it's kind of a step back unless we make those queries very fast. I've done some work making sure we have indices where needed but we need more.

There are lots of things we can do to improve performance. Prioritization is the hard part. As for queries most things can be improved with materialized views but at our stage this might be overkill. What we need now are results and fast.

  • Lighthouse recommends using http2 (should be easy to do in the reverse proxy)
  • We need to make the main page very fast ... The thing that slows this down is needing to compute a rank score for every item for ordering them
    • In practice we don't need to do this for every item ... only the ones we expect might be on the front page, i.e. the posts from the last week. While it's a bit of a hack we can filter our query by creation time, then compute the rank score for the remaining
    • Alternatively, we can create a materialized view of items and update it concurrently but this creates problems for pagination and we need a good strategy for refreshing the materialized view (probably just when upvotes happen). I see this as a longer term solution.
    • There might some way of combining these two approaches ...
  • The notifications query is big and slow and will only get worse, but denormalizing it is probably a mistake
    • the move here is to probably go back to client side rendering notifications until we come up with something better
    • we can create a materialized view of this in the long run
  • Items query is fast but computing comments is slow
    • we can lazy load/client side render comments
    • we could also materialize items with a JSON comments column with them already prefetched and nested ... but comments are ranked so they'll need to be refreshed when new comments are added or upvoted
  • Serve scripts and static assets out of a CDN (probably marginal improvement given clients cache but would make the site faster for first time/irregular visitors)

[Feature request] Allow website to be accessed via RSS

This website has been a great resource for Bitcoin news and being able to anonymously log in via the Lightning network is ingenious.

However, the fact that the website is just that makes it easy to forget to check regularly for news. Being able to access the website via RSS will allow a user to subscribe to the website (possibly even using specific parameters) so they will always know when a new post they care about is made.

Show the highest rank an item achieved

Something users tend to do is post screenshots when their item is on the frontpage (also seen this for HN and reddit). It'd be nice for the post to simply indicate the highest rank the posts have received instead - this is complicated by boost in our case but still an interesting habit we can maybe make easier.

Add WebLN

Wallet providers use a protocol (https://webln.dev/) to make sending lightning payments less cumbersome is my understanding. It'd be nice to support this.

URL dupe protection

Occasionally people post duplicate URLs. This isn't a huge issue ATM but it'd be nice to be able to detect it and display a warning - and possibly disallow it if it happens within a certain timeframe of the past post.

Probably doesn't need to be complicated. Remove trailing slash, case insensitive, https/http insensitive, and remove query params (although some sites use query params to specify which post, e.g. HN does this sadly, but we can probably just have some kind of whitelist) then compare.

Open source analytics

Plausible has a feature that makes the dashboard publicly accessible which is nice. Users should know everything I know.

RSS Feed Errors

When navigating to the rss feed, I get the following error:

XML Parsing Error: not well-formed
Location: https://stacker.news/rss
Line Number 86, Column 99:
      <link>https://twitter.com/irisenergyco/status/1428677975537377285?t=esQNOfvjbmpMrItP9oHjSA&s=19</link>
--------------------------------------------------------------------------------------------------^

Additional post types

Currently we only have links and discussions but we can support more types to give users more options.

  • images
  • videos
  • q&a bounties (tbd the rules)
  • polls (one sat per vote)

display balance on wallet page

i know that the second number besides my name (nathanael [2,1]) means that i have one satoshi, but i think on the wallet page it is useful to also display the balance above the two buttons (fund / withdraw)

btw. there is a little typo: withdraw and not withdrawl (for the withdraw button on the wallet page)

Tips

It'd be nice to give larger rewards to users than a single upvote.

Enable SN in Breez (with WebLN)

WebLN is a pre-requisite for the app to be included in Breez and other lightning apps.

The implementation can be fairly simple, https://webln.dev/#/ and when ready worth pinging some of the teams like Breez to include SN there.
This would be both useful and also good marketing ;)

Provide free/libre terms for comments and other content

Provide verbiage so that user comments and other user submitted content is clearly under a free/libre license (CC0, CC-BY, CC-BY-SA).

In my opinion, one of the reasons for StackOverflow's success is that the questions and answers are provided to the community under a free/libre license (CC-BY-SA 4.0). StackOverflow (SO) terms of service specifically addresses the point (under "Subscriber Content") and users who post on the site agree to provide their content under said license so that others can share and distribute it:

You agree that any and all content, including without limitation any and all text, graphics, logos, tools, photographs, images, illustrations, software or source code, audio and video, animations, and product feedback (collectively, “Content”) that you provide to the public Network (collectively, “Subscriber Content”), is perpetually and irrevocably licensed to Stack Overflow on a worldwide, royalty-free, non-exclusive basis pursuant to Creative Commons licensing terms (CC BY-SA 4.0), and you grant Stack Overflow the perpetual and irrevocable right and license to access, use, process, copy, distribute, export, display and to commercially exploit such Subscriber Content, even if such Subscriber Content has been contributed and subsequently removed by you as reasonably necessary ...

Though there are many sites that effectively duplicate SO, SO remains popular and there's probably an argument that even though there are many copycats, SO is probably enhanced by the duplication rather than inhibited by it.

Contrast this with Hacker News (HN) and their restrictive prohibition on using other people's comments on their site:

Commercial Use: Unless otherwise expressly authorized herein or in the Site, you agree not to display, distribute, license, perform, publish, reproduce, duplicate, copy, create derivative works from, modify, sell, resell, exploit, transfer or upload for any commercial purposes, any portion of the Site, use of the Site, or access to the Site. The buying, exchanging, selling and/or promotion (commercial or otherwise) of upvotes, comments, submissions, accounts (or any aspect of your account or any other account), karma, and/or content is strictly prohibited, constitutes a material breach of these Terms of Use, and could result in legal liability.

There's a saying by Quinn Norton that says

All data, over time, approaches deleted, or public.

I'm a fan of the HN community but the restriction on their user provided content is a mistake, in my opinion, and I worry it's inevitable that the HN data is lost or unusable in some pretty meaningful ways. If HN ever did decide to give the data to the community, my bet is that it would be at a point when they're shuttering and "throwing it over the fence" at which time it's utility would be a shadow of what it is now.

It would be nice if SN could avoid HN's mistake and make sure to provide user submitted content in what I believe is the spirit in which it was created, as a resource to the public and available to everyone, even for commercial re-use.

Provide API

Hacker News has an API to their data, providing an interface to query data from their site in JSON (see here). Hacker News provides it through firebaseio, so maybe it's worth pushing this to another service but the basic form would be something in the form of https://stacker.news/items/1130.json?print=pretty with the resulting item JSON closely mirroring the database schema.

Other tables in the database schema could be accessed similarly.

I do see an api directory so maybe this is already implemented? If so, it would be good to document. If not, then having an API so that other hackers can look at the data would be cool.

Upvote/tip/boost abort/delay window

It would be nice to be able to "undo" an upvote, tip or boost. From what I understand, the upvote/tip/boost (UpTiBo) represents an actual transaction on the Lightning network which, in my opinion is "the right way", so once the transaction is sent, there's no going back. To try and mitigate a mistaken UpTiBo, the transaction could be delayed for 5s, say, allowing a user to do a 'quick undo' with the understanding that waiting any longer than that will finalize the transaction.

I believe Gmail does something similar, allowing you to 'undo send' of an email by holding it for some number of seconds/minutes before finally pushing it through.

I think most of the time, people will realize their mistake within some short time, like 5s, taking care of 90%+ of the cases where users would want to rescind their UpTiBo.

I would consider this a very low priority, "nice to have" feature and nothing that is significantly interfering with the user (or my) experience.

ETIMEDOUT messages in logs

Getting quite a few of these message in the logs. These could be happening for a number of reasons. They appear to be intermittent and might not be avoidable but there might be a better way to handle it.

Sep 12 16:42:37 ip-172-31-87-148 web: [next-auth][error][client_fetch_error]
Sep 12 16:42:37 ip-172-31-87-148 web: https://next-auth.js.org/errors#client_fetch_error session FetchError: request to https://stacker.news/api/auth/session failed, reason: connect ETIMEDOUT 35.168.134.186:443
Sep 12 16:42:37 ip-172-31-87-148 web: at ClientRequest.<anonymous> (/var/app/current/node_modules/node-fetch/lib/index.js:1461:11)
Sep 12 16:42:37 ip-172-31-87-148 web: at ClientRequest.emit (events.js:376:20)
Sep 12 16:42:37 ip-172-31-87-148 web: at TLSSocket.socketErrorListener (_http_client.js:475:9)
Sep 12 16:42:37 ip-172-31-87-148 web: at TLSSocket.emit (events.js:376:20)
Sep 12 16:42:37 ip-172-31-87-148 web: at emitErrorNT (internal/streams/destroy.js:106:8)
Sep 12 16:42:37 ip-172-31-87-148 web: at emitErrorCloseNT (internal/streams/destroy.js:74:3)
Sep 12 16:42:37 ip-172-31-87-148 web: at processTicksAndRejections (internal/process/task_queues.js:82:21) {
Sep 12 16:42:37 ip-172-31-87-148 web: type: 'system',
Sep 12 16:42:37 ip-172-31-87-148 web: errno: 'ETIMEDOUT',
Sep 12 16:42:37 ip-172-31-87-148 web: code: 'ETIMEDOUT'
Sep 12 16:42:37 ip-172-31-87-148 web: }

[Feature request] - More detailed documentation/info

  1. FAQ page. You need to give more information about how to use this and fees applied, votes etc
  2. Using the free credits to post - OK. But after posting those, it doesn't say how much I need to pay for a new post.
  3. It should be also available the option to just pay a LN invoice for a new paid post, if I do not have enough funds in wallet

[RSS] `link` should link to linked article, not `guid`

When pulling from the RSS feed, the format for an item is as follows:

...
    <item>
      <guid>https://stacker.news/items/1098</guid>
      <title>Lightning Voucher ATM Coming Soon ⚡️🏧</title>
      <link>https://stacker.news/items/1098</link>
      <pubDate>Sun, 15 Aug 2021 20:32:02 GMT</pubDate>
    </item>
...

For folks subscribing to the RSS feed:

  • The link doesn't go to the article but rather the entry on stacker.news which seems surprising to me
  • There is no way to get the address of the linked article but to do another query to stacker.news

It would be much nicer, in my opinion, if the link field had the address of the linked article (in the above example https://twitter.com/ltngstore/status/1426950427346542594?s=20).
At the very least, adding another field that has the proper link would be nice.

Obviously this can't happen for all items, as some the main link is the guid, but where appropriate it would be good to provide the link.

Require less GitHub permissions to log in

First of all thanks for the project, it's pretty cool!

When trying to log in with GitHub I've noticed that it requires read & write permission for:

  • Private email address
  • Profile info
  • Followers

I think we could probably relax this a bit to just require reading public data, since it appears that the login is what we are interested in. I might be wrong since I'm not too familiar with next-auth so feel free to close this issue if so.

Screenshot 2021-10-04 at 12 01 05

[Feature request] @ mentions in comments

A few users have been trying to use @ mentions to get a users attention in comments. These should at least link to a users profile but it'd be better if they also showed up in @their notifications.

'1 sat' popover gets glitchy after comment submission

It just ends up in a random place.

I suspect the issue is that the 'reply' button is sometimes removed from the DOM while the popover is still active ... it doesn't always happen so there's probably a race condition. Probably just requires hiding the popover before submitting the comment form.

Provide instructions on test environment or VM (Docker, etc.) for testing environment

Though it might be obvious to engineers that are better than myself, how to get a test environment working is not clear to me. It would be nice to have some minimal instructions on how to get a development setup working so that getting familiar with the environment is as easy as possible.

Better yet, it might be nice to provide a Docker container so that people can experiment with something that's pre-built.

I got as far as running the web service but, in the couple minutes I looked at it, I couldn't figure out how to hook up or create the database, so gave up. A little more documentation on how to get a dev environment working or providing a Docker container would help speed up this on-boarding.

[Internals] Polymorphish data model for sat transfers

The only sat transfer mechanism we really have currently is the vote and boost (which is in the same db table but differentiated with a boolean). Even the dust cost of posting and commenting is kind of recorded as a vote.

We want to support many types of sat transfers on the site eventually. To name a few immediate ideas:

  • tips
  • referrals
    • e.g. every user who signs up with your referral link gets 20 sats and you get 20 sats
  • faucets/rewards
    • e.g. 10 free sats when you sign up, 100 sats if you visit every day this week, 1000 free sats if you post a story that gets to the front page, etc.

Eventually:

  • gating replies to your posts/comments with custom sat amounts
    • e.g. every reply to this thread must 'stake' 10 sats rather than 1 sat
  • Q&A bounties
    • e.g. the best answer to my question by Saturday gets 1000 sats and if I don't pick a winner it's distributed to all answerers
  • sub-stacker (read subreddit) economies, i.e. create subs with different sat-based unit economics
    • e.g. every post in this sub-stacker costs 100 sats (X amount goes to the sub mod, Y amount is airdropped on the sub users, Z goes to the site), comments cost 25 sats, etc.
  • Let users set a sat cost for mentioning them , i.e. charge users for consuming your attention
  • DM's gated with a sat cost
    • e.g. pay per message or pay to unlock a conversation with me

The sky is the limit IMO and we are going to the moon my plebs! These are naive examples. The incentives will have to be carefully examined before deploying of course.


Anyway, we don't want a DB table for all of these so we should probably have something more generic. The trick is making something intended to be generic also performant/correct so we should deliberately design such a system.

Off the top of my head it's probably best to have an xfer model with a sender id then we have a polymorphic receiver (e.g. an item (post/comment), a user for direct tips, a message for message hurdles) ... I'm not sure how well all of these will fit into this model so I'll probably attempt an exhaustive experiment to make sure any particular design fits.

Dark mode

Users want this. I do too but I keep forgetting.

Use deterministic build id

Because we deploy across more than one server and build independently on each server, each server gets a different build id. This build id is used to address artifacts on the server and if the load balancer does not stick a client to a particular server, then they might end up referencing build artifacts that exist on one server but not the others.

Solution is probably to use the git commit id.

SSR

I initially avoided SSR because I wanted to use clientside caching and I didn't understand the cache too well. The trouble is that if I'm SSRing I have to send from the server a dehydrated cache to be rehydrated on the client. I'm a little more savvy with the cache now ... Probably worth doing considering the perceived speed up for users.

async-retry bug?

Got a. report on twitter that async-retry might not work with a try block inside or something like that. Need to investigate. We use this for when there are serialization conflicts when updating user wallet balances.

Onion address

Some folks may feel better if stacker.news are available via onion (Tor) network. It can also help in your search for decentralization as Tor now has Onionbalance to distribute the service on multiple hosts while serving it over one onion link.

The operation cannot be completed. (OAuthSwiftError error -2.)

I noticed a while ago I started getting the above error on macOS when manually refreshing my feed.

Through discussion in the #general Slack channel, it was determined that this error is caused due to a tokenExpired status for an enabled Twitter extension (not sure if it would also apply to the Reddit extension as well since I did not have that extension enabled).

A simple fix that was suggested to me was to deactivate the extension and then reactivate. I can confirm this worked. I also revoked NetNewsWire from accessing my Twitter account and re-enabled it, but they may not have been necessary. Based on the language on the Twitter page, NetNewsWire's access had not be previously revoked.

Was told to open an issue so it could be kept track of.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.