NebulaNebula
Nebula Cloud

Deployment and Operations

Deploy the Nebula Cloud reference implementation, understand the API contract, or build your own backend.

Nebula Cloud is a reference implementation that provides only the most basic user management and version management. In production, you should extend it or build your own backend. In either case, your service must implement the runtime-required interfaces defined in Nebula Cloud API, otherwise the Nebula runtime cannot download and install miniapps.

What Nebula Cloud provides

Nebula Cloud is built with NestJS and Prisma and includes the following baseline capabilities:

CapabilityDescription
User registration and loginEmail/password authentication and JWT
CLI device authorizationOAuth device flow for nebula auth login
Miniapp registrationCreate miniapps and manage metadata
Version uploadReceive bundle and manifest uploads from the CLI
Version publishingDRAFT → PUBLISHED direct publishing
Channel publishingtest / stable channel separation
Bundle deliveryDownload endpoints used by the runtime

What Nebula Cloud does not provide

  • CDN delivery
  • automated review
  • team permissions
  • monitoring and analytics
  • content filtering
  • staged rollout
  • webhooks / notifications
  • multi-tenant support

Deploy Nebula Cloud

The project includes a docker-compose.yml with PostgreSQL and the application service.

git clone https://github.com/Hector-Zhuang/nebula.git
cd nebula/packages/nebula-cloud
docker compose up -d

After startup:

In production, always change JWT_SECRET, database credentials, and admin password in docker-compose.yml.

Common commands

# View logs
docker compose logs -f cloud

# Rebuild images
docker compose build --no-cache

# Stop services
docker compose down

# Stop and remove all data
docker compose down -v

Option 2: Manual deployment

Requirements

  • Node.js 20+
  • PostgreSQL 15+

1. Clone the repository and install dependencies

git clone https://github.com/Hector-Zhuang/nebula.git
cd nebula
npm install

2. Configure environment variables

Create a .env file in packages/nebula-cloud/:

DATABASE_URL=postgresql://user:password@localhost:5432/nebula_cloud
JWT_SECRET=your-random-secret-key
PORT=3001

3. Initialize the database

cd packages/nebula-cloud
npx prisma db push
npx prisma db seed

prisma db seed creates the default admin account ([email protected] / password123).

4. Start the service

# Development mode (hot reload)
npm run dev

# Production mode
npm run build
node dist/main

By default, the service listens on port 3001 and exposes APIs under /api.

Build your own backend

If the reference implementation does not meet your needs, you can build your own backend with any stack. The key requirement is that your service implements the runtime-required interfaces defined in Nebula Cloud API.