Self-Hosting
Follow this guide to deploy Elixpo Accounts in your own environment, whether for local development, docker, or deploying to production on Cloudflare Pages.
Local Development
1. Clone the repository and install dependency packages:
git clone https://github.com/elixpo/accounts.elixpo.git cd accounts.elixpo npm install
2. Set up local D1 SQLite database, run migrations, and spin up the development server:
# Copy the environment template cp .env.example .env.local # Run DB schema migrations on local SQLite/D1 instance npm run db:migrate:local # Start the Next.js development server npm run dev
Open http://localhost:3000 in your browser to view the Elixpo login/registration and developer dashboard.
Cloudflare Pages Production Setup
Elixpo Accounts is optimized for Cloudflare Pages (edge runtime) and Cloudflare D1. To deploy to your own Cloudflare account:
- Database: Create a Cloudflare D1 database named
elixpo_authin the Cloudflare dashboard. - Pages Project: Connect your repository to Cloudflare Pages. Select
Next.js (App Router)preset. - Bindings: In your Cloudflare Pages project settings, bind your D1 database to the variable name
DB. - Environment Variables: Configure required production variables under Pages Dashboard:
JWT_SECRET: High-entropy string for signing Access/Refresh tokens.SMTP_HOST/SMTP_USER/SMTP_PASS/SMTP_PORT: Configures sockets-based SMTP transport for sending transactional emails (OTP, resets).
Running Production Migrations
Run schema migrations on your production D1 instance via wrangler:
# Build validation check for edge runtime npm run pages:build # Apply migrations to remote production Cloudflare D1 wrangler d1 migrations apply elixpo_auth --remote
