Skip to content

Deployment

Dotnify is a serverless application — the backend uses serverless functions and the data layer uses Upstash Redis. No traditional server or database is needed.

Vercel

Vercel is the primary deployment target. The project includes a vercel.json with pre-configured rewrites and function settings.

One-Click Deploy

Click the button below to deploy Dotnify to your Vercel account. Vercel will clone the repository, set up the Upstash Redis integration, and deploy automatically.

Deploy with Vercel

During deployment, Vercel will prompt you to create an Upstash Redis instance through its built-in integration — no separate Upstash account setup is needed.

Manual Deploy

1. Create an Upstash Redis Database

Option A: Vercel Upstash Integration (Recommended)

Vercel provides a built-in Upstash Redis integration that lets you create and manage a Redis database directly from your Vercel project:

  1. Go to your Vercel project → Storage tab
  2. Click Create Database → select Upstash Redis
  3. Choose a region and click Create
  4. Vercel automatically injects UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN into your project's environment variables — no manual configuration needed

The Vercel Upstash integration is the easiest option because:

  • No separate Upstash account is required — everything is managed within Vercel
  • Environment variables are automatically linked to your project
  • You can view Redis metrics directly in the Vercel dashboard
  • The free tier includes 10,000 commands per day, which is sufficient for personal use

Option B: Standalone Upstash Account

  1. Go to Upstash Console and create a new Redis instance
  2. Copy the REST URL and REST Token — you'll need these as environment variables

2. Import the Project

  1. Fork or clone the Dotnify repository
  2. Go to Vercel Dashboard and import the repository
  3. Vercel will auto-detect the Vite framework

3. Configure Environment Variables

If you used the Vercel Upstash integration, the environment variables are already set. Otherwise, add them manually in the Vercel project settings:

VariableDescriptionRequired
UPSTASH_REDIS_REST_URLUpstash Redis REST URL (e.g. https://xxx.upstash.io)Yes
UPSTASH_REDIS_REST_TOKENUpstash Redis REST tokenYes

4. Deploy

Click Deploy. Vercel will build the project and deploy it. The build uses npm run build which compiles the React frontend with Vite.

Vercel Configuration

The project includes a vercel.json that configures:

json
{
  "buildCommand": "npm run build",
  "outputDirectory": "dist",
  "framework": "vite",
  "rewrites": [
    { "source": "/api/(.*)", "destination": "/api/$1" },
    { "source": "/((?!api/).*)", "destination": "/index.html" }
  ],
  "functions": {
    "api/**/*.ts": {
      "memory": 256,
      "maxDuration": 10
    }
  }
}
  • Rewrites: API routes are served directly; all other routes fall through to the SPA
  • Functions: Each serverless function is allocated 256 MB memory and a 10-second timeout

Local Development

To run Dotnify locally with the full API:

The project includes a custom Vite plugin (scripts/vite-plugin-dev-api.ts) that serves the API functions directly during vite dev, so you don't need vercel dev.

  1. Create a .env.local file in the project root:
bash
UPSTASH_REDIS_REST_URL="https://your-redis.upstash.io"
UPSTASH_REDIS_REST_TOKEN="your-redis-token"
  1. Start the dev server:
bash
npm run dev

The app will be available at http://localhost:5173. API edits are picked up on the next request (no manual restart needed).

Option B: Using Vercel Dev

bash
npm run dev:api

This uses vercel dev which emulates the Vercel serverless environment locally. It reads .env.local for environment variables.

Data Storage

Dotnify uses three Redis keys to store all application state:

KeyDescription
dotnify:adminAdmin credentials (username + scrypt password hash)
dotnify:session:<token>Active session (7-day TTL, auto-expires)
dotnify:providersJSON array of configured DNS providers

No database schema or migrations are needed. Upstash Redis is serverless and billed per request, making it a good fit for low-traffic management tools.

Security Considerations

  • Password hashing: Admin passwords are hashed with scrypt (64-byte key length) before storage
  • Session tokens: 32-byte random tokens with 7-day TTL in Redis
  • Timing-safe comparison: Password verification uses crypto.timingSafeEqual to prevent timing attacks
  • API key masking: Provider API keys are masked in API responses (only last 4 characters visible)
  • Bearer token auth: All API endpoints (except /api/auth/me and /api/auth/setup) require a valid Bearer token
  • No CORS configuration: The API is same-origin only — the SPA and API are served from the same deployment