Code Monkey home page Code Monkey logo

beam's People

Contributors

aybabtme avatar ayrton avatar bogdansoare avatar dependabot[bot] avatar dgraham avatar garciasdos avatar iamluisj avatar jasonlong avatar jgreet avatar jonico avatar marissamarym avatar mscoutermarsh avatar pixeljanitor avatar skottler avatar sukoonmusic avatar tautastic avatar thejessewinton avatar with-heart avatar

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  avatar  avatar  avatar  avatar  avatar

beam's Issues

Setup Help

I'm kinda new MySQL Databases

As I scrolled through the web, I came across this project and thought it would be useful for my company

thing is, i did all the other steps in the setup correctly, and i need help for the PlanetScale part

@jasonlong please help

can`t sign in

I set .env file well as github_setup.md says

but it showed up below

→ 11 const account = await p.account.findUnique(
The table (not available) does not exist in the current database. {
message: '\n' +
'Invalid p.account.findUnique() invocation in\n' +
'C:\planet\beam-main\beam-main\node_modules\@next-Auth\prisma-adapter\dist\index.js:11:45\n' +
'\n' +
' 8 getUserByEmail: (email) => p.user.findUnique({ where: { email } }),\n' +
' 9 async getUserByAccount(provider_providerAccountId) {\n' +
' 10 var _a;\n' +
'→ 11 const account = await p.account.findUnique(\n' +
' The table (not available) does not exist in the current database.',
stack: 'Error: \n' +
'Invalid p.account.findUnique() invocation in\n' +
'C:\planet\beam-main\beam-main\node_modules\@next-Auth\prisma-adapter\dist\index.js:11:45\n' +
'\n' +
' 8 getUserByEmail: (email) => p.user.findUnique({ where: { email } }),\n' +
' 9 async getUserByAccount(provider_providerAccountId) {\n' +
' 10 var _a;\n' +
'→ 11 const account = await p.account.findUnique(\n' +
' The table (not available) does not exist in the current database.\n' +
' at cb (C:\planet\beam-main\beam-main\node_modules\@prisma\client\runtime\index.js:38703:17)\n' +
' at async PrismaClient._request (C:\planet\beam-main\beam-main\node_modules\@prisma\client\runtime\index.js:40853:18)\n' +
' at async getUserByAccount (C:\planet\beam-main\beam-main\node_modules\@next-Auth\prisma-adapter\dist\index.js:11:29)',
name: 'Error'
}
[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR]
https://next-auth.js.org/errors#oauth_callback_handler_error
Invalid p.account.findUnique() invocation in
C:\planet\beam-main\beam-main\node_modules@next-auth\prisma-adapter\dist\index.js:11:45

8 getUserByEmail: (email) => p.user.findUnique({ where: { email } }),
9 async getUserByAccount(provider_providerAccountId) {
10 var _a;
→ 11 const account = await p.account.findUnique(
The table (not available) does not exist in the current database. Error:
Invalid p.account.findUnique() invocation in
C:\planet\beam-main\beam-main\node_modules@next-auth\prisma-adapter\dist\index.js:11:45

8 getUserByEmail: (email) => p.user.findUnique({ where: { email } }),
9 async getUserByAccount(provider_providerAccountId) {
10 var _a;
→ 11 const account = await p.account.findUnique(
The table (not available) does not exist in the current database.
at cb (C:\planet\beam-main\beam-main\node_modules@prisma\client\runtime\index.js:38703:17)
at async PrismaClient._request (C:\planet\beam-main\beam-main\node_modules@prisma\client\runtime\index.js:40853:18)
at async getUserByAccount (C:\planet\beam-main\beam-main\node_modules@next-auth\prisma-adapter\dist\index.js:11:29) {
name: 'GetUserByAccountError',
code: 'P2021'
}

Does it support tagging posts?

I've not been able to find anywhere whether or not it supports applying tags to posts? That would be the killer feature for me, in terms of being able to organize content.

Out of sort memory, consider increasing server sort buffer size (errno 1038) for Long Posts on PlanetScale Database

This particular issue has already been fixed in MySQL 8.0.28 as described here:
https://bugs.mysql.com/bug.php?id=105304

But is something that can be experienced on versions of MySQL prior to that (which currently includes PlanetScale databases since internally we are running on 8.0.23 as of today's date).

There is a workaround available for adjusting the sort_buffer_size value for the current database session which has worked for other developers using PlanetScale as their database:
https://stackoverflow.com/questions/29575835/error-1038-out-of-sort-memory-consider-increasing-sort-buffer-size

However, this is something we may want to have a configuration value for when it comes to Beam users, that way they do not have to make any core customizations to the Beam source code.


This has primarily come up via a report from a PlanetScale user that was experiencing trouble with their Beam installation after importing a long post and it appeared that the issue arose due to the length of the post itself.

Error encountered:

{
   "user_facing_error":"None",
   "kind":"QueryError(Server(ServerError"{
      "code":1038,
      "message":"target: beam.-.primary: vttablet: rpc error: code = ResourceExhausted desc = Out of sort memory, consider increasing server sort buffer size (errno 1038) (sqlstate HY001) (CallerID: planetscale-admin): Sql: \"select Post.id, Post.title, Post.contentHtml, Post.createdAt, Post.hidden, Post.authorId, aggr_selection_0_Comment._aggr_count_comments from Post left join (select `Comment`.postId, COUNT(*) as _aggr_count_comments from `Comment` group by `Comment`.postId) as aggr_selection_0_Comment on Post.id = aggr_selection_0_Comment.postId where Post.hidden = :v1 order by beam.Post.createdAt desc limit :v3, :v2\", BindVars: {#maxLimit: \"type:INT64 value:\\\"100001\\\"\"v1: \"type:INT64 value:\\\"0\\\"\"v2: \"type:INT64 value:\\\"7\\\"\"v3: \"type:INT64 value:\\\"0\\\"\"}",
      "state":"HY001"
   }"))"
}

Further context:

After several tests, I realize that is not about how many posts. It is actually about whether there is a super long post.
For example, you could import https://danluu.com/nothing-works/ as a beam post. Then your index would pop up such an error.
The only exception is when you set POSTS_PER_PAGE to 1, your index page (page 1). But you cannot get page 2 then.

So, I think if beam could limit the length of post (currently, there is a limit, but could be too loose to get avoid of the mysql bug), it could be super helpful.

Limiting the length of the post however may not be necessary if the current workaround of increasing the sort_buffer_size value could be implemented within Beam itself.

Generally this is the value user's running into this problem have been asked to add on their end:

set sort_buffer_size=2097152

Make ⌘ + Enter submit

A common pattern for submitting a form is to have + Enter work rather than relying on the button to have focus. This would be great to have when publishing a post or adding a comment.

Using it as a news feed without auth

I know it is fundamentally designed as an internal team tool but is also very appealling as just a changelog / public feed with an easy authoring interface.

Is there a simple way to disable the whole auth thing and just have it public facing?

Make like count on index page non-interactive

@samlambert had the idea that the like button on the index page (when viewing a snippet of the post) is not actually clickable because you clearly haven't read the article if you're liking it there. We should, however, still show the tooltip with names.

Add Slack app

Maybe this lives in a separate repo, but let's build a Slack app that publishes to a specified channel when new posts are added to Beam.

Error Deploying to Vercel: Missing NEXT_APP_URL

I'm not sure if anyone else has run into this, but when I was trying to deploy to Vercel the build kept failing because it said I was missing NEXT_APP_URL, but the NextAuth.JS documentation says this variable isn't required when deploying to Vercel.

I double checked that "Automatically expose System Environment Variables" was turned on as well.

Error:
`

Build error occurred
--
21:42:36.838 | TypeError: ========================================
21:42:36.838 | 💨 Missing environment variables:
21:42:36.839 | NEXT_APP_URL: Missing value or empty string
21:42:36.839 | ========================================
21:42:36.840 | at d (/vercel/path0/node_modules/envsafe/dist/envsafe.cjs.production.min.js:1:3206)
21:42:36.840 | at exports.envsafe (/vercel/path0/node_modules/envsafe/dist/envsafe.cjs.production.min.js:1:4852)
21:42:36.840 | at Object.5395 (/vercel/path0/.next/server/pages/sign-in.js:81:37)
21:42:36.841 | at webpack_require (/vercel/path0/.next/server/webpack-runtime.js:25:42)
21:42:36.841 | at webpack_exec (/vercel/path0/.next/server/pages/sign-in.js:368:39)
21:42:36.843 | at /vercel/path0/.next/server/pages/sign-in.js:369:66
21:42:36.844 | at Function.webpack_require.X (/vercel/path0/.next/server/webpack-runtime.js:182:21)
21:42:36.844 | at /vercel/path0/.next/server/pages/sign-in.js:369:47
21:42:36.845 | at Object. (/vercel/path0/.next/server/pages/sign-in.js:372:3)
21:42:36.845 | at Module._compile (internal/modules/cjs/loader.js:1085:14) {
21:42:36.845 | type: 'TypeError'
21:42:36.846 | }
`

I was able to get it working by adding an environment variable for NEXT_APP_URL and a valid full URL.

From looking at the Vercel Documentation I wonder if this was changed to NEXT_PUBLIC_VERCEL_URL

If others are seeing this issue maybe something can be added to the readme like "When deploying to vercel you may have to set the NEXT_APP_URL which is validated as a URL so be sure to include the full URL. For example: https:///www.appName.vercel.app in your Environment Variables."

Make like and comment count buttons non-interactive on listings

Actually, the like button is already non-interactive and that's kind of the problem here. Since we made the decision to not allow liking from the listing views, it's confusing for people (I got tripped up myself recently) that the like count button looks identical to the one on the post page.

Let's give the like and comment count a different visual treatment and relocate them like this. The heart still shows filled if the current user has liked the post.

CleanShot 2022-02-18 at 10 43 22@2x

Poster name not included in search content

Currently, it seems as if using the search feature does not include the poster's name. So for example, if I want to see all posts by "Ben Dicken" I can't just put "Ben Dicken" in the search and get those results. It will only show posts where my name is in the body. I think it would be nice to include poster name (and perhaps post title?) as a part of the search content.

Occasional error while trying to auth

@bogdansoare I've noticed this problem happening once in a while on my phone and iPad:

CleanShot 2022-02-06 at 21 34 36@2x

It seems to happen when I pull down in Safari to refresh and the URL shows https://beam.psdb.co/api/auth/error. Any ideas?

Show the content of a post when notifying Slack

Description

Show the content of a post in the Slack message when notifying a Slack channel.

Screen Shot 2022-02-24 at 5 09 30 PM

Example

Here is an example post on Beam:

Screen Shot 2022-02-24 at 5 10 08 PM

Current behaviour of the Slack notification

Shows the link, title, and author
Screen Shot 2022-02-24 at 5 09 20 PM

Proposed behaviour of the Slack notification

Shows the link, title, author, and content
Screen Shot 2022-02-24 at 5 09 30 PM

Possible solution

Using the https://github.com/instantish/mack package to convert markdown to Slack blocks.

Trade-offs: it adds another dependency, Slack messages will take up more vertical space in the channel.

Alternatives: just show the first few lines of text with an ellipsis, or just preview the images.

Possible to disable parts of prettier-plugin-organize-imports?

@bogdansoare Is it possible to turn off the feature of prettier-plugin-organize-imports that auto deletes unused imports? It drives me crazy how you can type an import and have it disappear immediately because it's not being used yet. I've heard this from a couple of other people who have worked on the app.

Otherwise, it would be nice to find a different config to handle unused imports. I can share what we use on the PlanetScale app if it's helpful.

Preview app login serves 400

Hello T Beam! I went to check out the preview site listed in this repo's description (http://beam.preview.planetscale.com/) and hit Sign in with Okta - I get this:

image

Presumably y'all meant for the public, preview deployment to use GitHub auth? Either way, I don't think that error is what you're expecting, so flagging! 🐛

Update `prisma` dependency to a recent version (4.7.x or higher)

This project is currently using an older version of Prisma. Since it's a popular and useful reference project for using PlanetScale, Prisma and Next.js, I was wondering if it would be possible to upgrade Prisma to the latest version.

I recommend using Prisma version 4.7.0 or higher since in 4.7.0, the Relation mode feature (previously known as Referential Integrity) went GA.

You can learn more about this change in the Prisma Relation mode documentation and release notes for 4.7.0. For further context, this Pull request shows the update made to the PlanetScale docs related to this.

You can also learn more about upgrading to Prisma version 4 in the Prisma documentation.

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.