A lightning prism management interface that helps you manage and control payment splits on the Lightning Network. Aurora provides tools for creating, managing, and monitoring lightning payment distributions through prisms.
This is a work in progress. Things are rapidly being built and changed on various branches. Design and UX planning is happening in these docs:
- Node.js (v18 or later)
- Docker and Docker Compose
- A Phoenix node running locally or remotely
- Clone the repository:
git clone https://github.com/ATLBitLab/aurora.git
cd aurora- Install dependencies:
yarn install- Set up environment variables:
# Copy the example env file and modify as needed
cp .env.example .envAurora uses Better Auth for authentication with email/password login.
- Generate a secret key for Better Auth:
openssl rand -base64 32- Update your
.envfile with the following variables:
# Better Auth Configuration (REQUIRED)
BETTER_AUTH_SECRET=your-generated-secret-key
# Application URL
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Trusted origins (include your production URL when deploying)
BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:3000To restrict who can create accounts, set the ALLOWED_EMAILS environment variable with a comma-separated list of allowed email addresses:
# Only these emails can create accounts
ALLOWED_EMAILS=admin@example.com,team@example.com,developer@example.comIf this variable is not set or is empty, any email address can register.
- Start the application
- Click "Sign In" on the homepage
- Click "Sign up" to create a new account
- Enter your email, password (min 8 characters), and name
- You'll be automatically signed in after registration
Aurora uses PostgreSQL for data storage, running in Docker for easy setup and management.
If you are only working on the frontned UI, you can use a staging database on Supabase. In your .env, add this:
DATABASE_URL="postgresql://postgres.PROJECT_ID:PASSWORD@aws-1-us-east-2.pooler.supabase.com:5432/postgres"
Replace PROJECT_ID and PASSWORD with the proper credentials.
- Start the PostgreSQL container:
docker compose up -dThis will:
- Create a PostgreSQL 15 instance
- Set up a persistent volume for data storage
- Expose the database on port 5432
- Configure the following credentials:
- User: aurora
- Password: aurora_dev_password
- Database: aurora_db
- Apply database migrations:
npx prisma migrate devThe project includes seed data to help you get started quickly. The seed data includes 5 sample contacts with various fields and metadata:
- Load the seed data:
npx prisma db seedThis will create sample contacts including:
- Satoshi Nakamoto (with social media and interests)
- Alice Lightning (with Nostr integration)
- Bob Builder (developer profile)
- Carol Crypto (privacy advocate)
- Dave Decentralized (web5 developer)
To reset the database and reload seed data:
# Reset the database
npx prisma migrate reset
# Or manually:
npx prisma db push --force-reset
npx prisma db seedCommon database management commands:
# View database logs
docker compose logs postgres
# Stop the database
docker compose down
# Stop the database and remove volume (CAUTION: This will delete all data)
docker compose down -v
# Access PostgreSQL CLI
docker compose exec postgres psql -U aurora -d aurora_db
# Generate Prisma client after schema changes
npx prisma generate
# Create a new migration after schema changes
npx prisma migrate dev --name <migration_name>The database includes:
- User/Session/Account tables: For Better Auth authentication
- contacts table:
- UUID-based IDs
- Optional fields for basic info (firstName, lastName, etc.)
- Nostr integration (pubkey storage)
- Flexible JSON metadata field for extensibility
- Optimized indexes for common queries
Example contact structure:
{
id: "uuid",
firstName: "Alice",
lastName: "Lightning",
screenName: "alicezap",
nostrPubkey: "npub...",
email: "alice@lightning.btc",
metadata: {
telegram: "@alicezap",
interests: ["lightning", "bitcoin"],
preferredPaymentMethod: "lightning"
}
}Start the development server:
yarn devThe application will be available at http://localhost:3000.
If you're developing on Windows and experiencing issues with the database connection or environment variables not being picked up, try these solutions:
Windows may create .env files with CRLF line endings, which can cause issues with environment variable parsing.
Fix: Convert your .env file to LF line endings:
# In PowerShell, recreate the .env file with proper line endings
$content = Get-Content .env.example -Raw
$content = $content -replace "`r`n", "`n"
$content | Set-Content .env -NoNewline
# Then edit .env with your valuesOr use VS Code: Open .env, click "CRLF" in the bottom-right status bar, and select "LF".
If Prisma can't connect to the database even though your .env is correct:
Option A: Load environment variables explicitly before running Prisma:
# PowerShell
$env:DATABASE_URL = "your-database-url-here"
npx prisma migrate dev:: Command Prompt
set DATABASE_URL=your-database-url-here
npx prisma migrate devOption B: Use dotenv-cli to ensure .env is loaded:
npx dotenv -e .env -- npx prisma migrate devIf you're using Docker Desktop with WSL2 and can't connect to the PostgreSQL container:
Fix: Use host.docker.internal instead of localhost in your connection string:
# In .env, try this instead of localhost
DATABASE_URL="postgresql://aurora:aurora_dev_password@host.docker.internal:5432/aurora_db"Or ensure your PostgreSQL container is exposing the port correctly:
# Check if the port is accessible
Test-NetConnection -ComputerName localhost -Port 5432If you're only working on the frontend UI, use the staging Supabase database to avoid local setup issues entirely:
DATABASE_URL="postgresql://postgres.PROJECT_ID:PASSWORD@aws-1-us-east-2.pooler.supabase.com:5432/postgres"Ask a maintainer for the staging credentials.
The openssl command may not be available on Windows. Alternatives:
# PowerShell - generate a random base64 string
[Convert]::ToBase64String((1..32 | ForEach-Object { Get-Random -Maximum 256 }) -as [byte[]])Or use an online generator like generate-secret.vercel.app.
- Use Git Bash or WSL for a more consistent experience with bash commands
- Run PowerShell as Administrator if you encounter permission issues
- Check your Node.js version:
node --version(should be v18+) - Restart your terminal after modifying
.envfiles
If you continue to have issues, reach out in the ATL BitLab Discord!
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
BETTER_AUTH_SECRET |
Secret key for Better Auth (generate with openssl rand -base64 32) |
Yes |
NEXT_PUBLIC_APP_URL |
Application URL for auth callbacks | Yes |
BETTER_AUTH_TRUSTED_ORIGINS |
Comma-separated list of trusted origins | Yes |
PHOENIXD_HOST |
Phoenix node host address | Yes |
PHOENIXD_HTTP_PASS_LIMITED |
Phoenix node limited access password | Yes |
ALLOWED_EMAILS |
Comma-separated list of allowed email addresses (optional) | No |
The build uses yarn run vercel-build (see vercel.json), which runs prisma generate then yarn build. Do not use prisma migrate dev in the Vercel build—it requires a live DB and fails on preview/production.
- If the Vercel dashboard has a custom Build Command, set it to
yarn run vercel-buildor clear it sovercel.jsonis used. - Run migrations against your production DB separately (e.g.
prisma migrate deployin a one-off job or CI step withDATABASE_URLset).
- Create a feature branch
- Make your changes
- Submit a pull request
[Add your license here]
