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 usenpmoryarn. - Upstash Account: You need an account on Upstash for Redis and Realtime.
Environment Configuration
-
Clone the repository (if you haven't already).
-
Create a
.envfile in the root directory:cp .env.example .env(If
.env.exampledoesn't exist, create a new.envfile). -
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
realtimelibrary 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 installUsing npm:
npm installRunning the Development Server
Start the local development server:
bun dev
# or
npm run devOpen 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