Manual Setup
Prerequisites
Section titled “Prerequisites”- Node.js 20+
- A Supabase project
- A server or cloud platform (Railway, Fly.io, Render, AWS, etc.)
1. Clone and Build
Section titled “1. Clone and Build”git clone https://github.com/Paparusi/passbox.gitcd passboxpnpm installpnpm build2. Set Up Supabase
Section titled “2. Set Up Supabase”Create a Supabase project and run migrations:
# Link to your Supabase projectsupabase link --project-ref your-project-ref
# Apply all migrationssupabase db push3. Configure Environment
Section titled “3. Configure Environment”Set environment variables on your server:
# Requiredexport PORT=3456export NODE_ENV=productionexport SUPABASE_URL=https://your-project.supabase.coexport SUPABASE_SERVICE_ROLE_KEY=eyJ...export SUPABASE_ANON_KEY=eyJ...
# Optionalexport STRIPE_SECRET_KEY=sk_live_...export STRIPE_WEBHOOK_SECRET=whsec_...export EXTRA_CORS_ORIGINS=https://your-dashboard.com4. Start the Server
Section titled “4. Start the Server”cd apps/servernode dist/index.jsThe server starts on the configured PORT (default: 3456).
Platform-Specific Guides
Section titled “Platform-Specific Guides”Railway
Section titled “Railway”# Install Railway CLInpm install -g @railway/cli
# Login and linkrailway loginrailway link
# Set environment variablesrailway variables set SUPABASE_URL=...railway variables set SUPABASE_SERVICE_ROLE_KEY=...railway variables set SUPABASE_ANON_KEY=...
# Deployrailway upFly.io
Section titled “Fly.io”Create a fly.toml:
app = "passbox-api"
[build] builder = "heroku/buildpacks:20"
[env] PORT = "3456" NODE_ENV = "production"
[[services]] internal_port = 3456 protocol = "tcp"
[[services.ports]] port = 443 handlers = ["tls", "http"]fly launchfly secrets set SUPABASE_URL=... SUPABASE_SERVICE_ROLE_KEY=... SUPABASE_ANON_KEY=...fly deployRender
Section titled “Render”- Connect your GitHub repo
- Set build command:
pnpm install && pnpm build --filter @pabox/server - Set start command:
node apps/server/dist/index.js - Add environment variables in the dashboard
5. Deploy the Web Dashboard (Optional)
Section titled “5. Deploy the Web Dashboard (Optional)”The web dashboard is a Next.js app that can be deployed to Vercel:
cd apps/webvercel deploy --prodSet the NEXT_PUBLIC_API_URL environment variable to your server URL.
6. Configure GitHub OAuth (Optional)
Section titled “6. Configure GitHub OAuth (Optional)”To enable GitHub login:
- Create a GitHub OAuth App at Settings > Developer settings > OAuth Apps
- Set callback URL to:
https://your-supabase-project.supabase.co/auth/v1/callback - In Supabase dashboard, go to Authentication > Providers > GitHub
- Enter your Client ID and Client Secret
Health Check
Section titled “Health Check”Verify your deployment:
curl https://your-server.com/api/v1/healthExpected response:
{ "success": true, "data": { "status": "healthy", "database": "connected" }}