Flux Docs

Getting Started

Setup instructions for local development

Getting Started

Follow these instructions to set up the project on your local machine for development and testing.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js: Version 18 or higher.
  • Package Manager: The project uses bun.lock, so Bun is recommended. You can also use npm or yarn.
  • Upstash Account: You need an account on Upstash for Redis and Realtime.

Environment Configuration

  1. Clone the repository (if you haven't already).

  2. Create a .env file in the root directory:

    cp .env.example .env

    (If .env.example doesn't exist, create a new .env file).

  3. Add the required Environment Variables: You need to get these credentials from your Upstash Console.

    # Upstash Redis Configuration
    UPSTASH_REDIS_REST_URL="https://your-database-name.upstash.io"
    UPSTASH_REDIS_REST_TOKEN="your-secret-token"
    • UPSTASH_REDIS_REST_URL: The REST URL for your Redis database.
    • UPSTASH_REDIS_REST_TOKEN: The REST Token for authentication.

    Note: The realtime library in this project (src/lib/realtime.ts) reuses the Redis connection, so you typically don't need separate Realtime credentials if you use the Redis integration for Realtime.

Installation

Install the project dependencies.

Using Bun (Recommended):

bun install

Using npm:

npm install

Running the Development Server

Start the local development server:

bun dev
# or
npm run dev

Open http://localhost:3000 with your browser to see the result.

Build for Production

To create a production build:

bun run build
```bash
bun run build
bun run start

On this page

Edit on GitHub