Home

Awesome

<img src="client/public/assets/logo.png" height="32px" alt="" /> Drift

Drift is a self-hostable Gist clone. It's also a major work-in-progress, but is completely functional.

You can try a demo at https://drift.lol. The demo is built on master but has no database, so files and accounts can be wiped at any time.

If you want to contribute, need support, or want to stay updated, you can join the IRC channel at #drift on irc.libera.chat or reach me on twitter. If you don't have an IRC client yet, you can use a webclient here.

<hr />

Contents:

Setup

Development

In both server and client, run yarn (if you need yarn, you can download it here.) You can run yarn dev in either / both folders to start the server and client with file watching / live reloading.

To migrate the sqlite database in development, you can use yarn migrate to see a list of options.

Production

yarn build in both client/ and server/ will produce production code for the client and server respectively.

If you're deploying the front-end to something like Vercel, you'll need to set the root folder to client/.

In production the sqlite database will be automatically migrated to the latest version.

Environment Variables

You can change these to your liking.

client/.env:

server/.env:

Running with pm2

It's easy to start Drift using pm2. First, add .env files to client/ and server/ with the values you want (see the above section for possible values). Then, use the following commands to start the client and server:

You now use pm2 ls to see their statuses. Refer to pm2's docs or pm2 help for more information.

Running with Docker

The client and server each have Dockerfiles (client, server) you can use with a docker-compose; an example compose is provided in the repository. It's recommended you pair running them with nginx or another reverse proxy. Also review the environment variables above and configure them to your liking.

Current status

Drift is a major work in progress. Below is a (rough) list of completed and envisioned features. If you want to help address any of them, please let me know regardless of your experience and I'll be happy to assist.