krider2010 / beam

A simple message board for your organization or project

Home Page:https://planetscale.com/blog/introducing-beam

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Beam is a simple tool that allows members to write posts to share across your organization. Think of it like a lightweight internal blog. Features include a simple Markdown-based editor with preview, image drag and drop, comments and likes, search, a clean responsive layout with dark mode support, and an admin role for hiding posts.

Setup

Install dependencies

npm install

Create a database

cp .env.example .env
  • Open .env and set the DATABASE_URL variable with the connection string from PlanetScale
  • Create the database schema:
npx prisma db push

Configure authentication

By default Beam uses GitHub for authentication, but you can use Okta if you prefer.

  • Create an OAuth app on GitHub (Note that a separate app must be created for production use)
    • Go to Developer Settings
    • Click on New OAuth App
    • For Callback URL, enter http://localhost:3000/api/auth/callback/github
    • Once the app is created, click Generate a new client secret
  • Set environment variables in .env
    • Set AUTH_PROVIDER to github
    • Set GITHUB_ID to the Client ID value
    • Set GITHUB_SECRET to the secret value generated above
    • Set GITHUB_ALLOWED_ORG to the GitHub organization name your Beam members must belong to
    • Set NEXTAUTH_SECRET to a random secret. This is a good resource.

Enable image uploads (optional)

To enable image uploads, set the environment variable NEXT_PUBLIC_ENABLE_IMAGE_UPLOAD to true.

Beam uses Cloudinary for storing uploaded images. You can sign up for a free account.

  • On your Cloudinary dashboard, look for these values under your account settings: Cloud Name, API Key, API Secret.
  • Update .env with the following variables:
    • CLOUDINARY_CLOUD_NAME: Cloud Name
    • CLOUDINARY_API_KEY: API Key
    • CLOUDINARY_API_SECRET: API Secret

Configure Slack notifications (optional)

If you'd like to have new Beam posts published to a Slack channel, follow these instructions.

Running the app locally

npm run dev

Open http://localhost:3000 in your browser.

Deploying to Vercel

One-click deploy:

Deploy with Vercel

The first build will fail because the environment variables need to be setup. These can be configured in the Vercel UI. Variables you might want to set can be found in the .env.example file.

⚠️ Remember to update your callback URLs in the GitHub OAuth app after deploying.

Deploying to Netlify

One-click deploy:

Deploy to Netlify

The first build will fail because the environment variables need to be setup. These can be configured in several ways but the easiest to get this up and running will be to visit the Site settings > Build & deploy > Environment > Environment variables in the Netlify UI. Variables you might want to set can be found in the .env.example file.

⚠️ Remember to update your callback URLs in the GitHub OAuth app after deploying.

About

A simple message board for your organization or project

https://planetscale.com/blog/introducing-beam

License:MIT License


Languages

Language:TypeScript 91.4%Language:JavaScript 4.8%Language:CSS 3.6%Language:Shell 0.3%