Drift screenshot

Drift

Author Avatar Theme by Maxleiter
Updated: 21 Jul 2023
1372 Stars

Drift is a self-hostable Gist and paste service. Built with Next.js 13 and React Server Components.

Categories

Overview:

DriftNote is a self-hostable Gist clone that is currently being refactored to Next.js 13 app directory and React Server Components. It is in beta but fully functional, allowing users to host their own instances. Drift is built with Next.js 13, React Server Components, shadcn/ui, and Prisma.

Features:

  • Self-hostable Gist clone: Users can host their own instances of Drift on their servers.
  • Built with Next.js 13 and React Server Components: Utilizes modern technologies for efficient performance.
  • Functionality: Fully functional beta version with the ability to create, share, and manage Gists.
  • Environment Variables: Customizable environment variables for configuration.
  • Support for pm2 and Docker: Easy deployment options with pm2 and Docker.
  • Authentication Options: Supports GitHub OAuth and credential authentication.

Installation:

Setup:

  1. In the root directory, run pnpm i to install dependencies.
  2. For file watching and live reloading during development, run pnpm dev in the client directory.
  3. To interact with the database using Prisma, use pnpm prisma or pnpm exec prisma.

Production:

  1. Run pnpm build to build production code.
  2. Start the Next.js server with pnpm start.

Environment Variables:

  • DRIFT_URL: URL of the Drift instance.
  • DATABASE_URL: URL to connect to the PostgreSQL database.
  • WELCOME_CONTENT: Markdown string displayed on the homepage.
  • ENABLE_ADMIN: First account created is an administrator account.
  • REGISTRATION_PASSWORD: Password required for account registration.
  • NODE_ENV: Defaults to development or production.

Auth Environment Variables:

  • GITHUB_CLIENT_ID: Client ID for GitHub OAuth.
  • GITHUB_CLIENT_SECRET: Client secret for GitHub OAuth.
  • NEXTAUTH_URL: URL of the Drift instance.
  • CREDENTIAL_AUTH: Whether to allow username/password authentication.

For detailed setup using pm2, Docker, or running with systemd, refer to the original documentation.

Summary:

DriftNote is a self-hostable Gist clone refactored with Next.js 13 and React Server Components. It offers key features such as self-hosting options, modern technology stack, functionality, customizable environment variables, and support for deployment using pm2 or Docker. Users can easily set up Drift with detailed installation instructions and configuration options.