Skip to content
arsyadalPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Cadsploy

Docker-first self-hosted deployment platform MVP.

Running Cadsploy itself on a VPS (not local dev)? See DEPLOY.md.

Stack

  • apps/web: Next.js dashboard
  • apps/api: Fastify API, GitHub OAuth, Prisma, BullMQ
  • apps/worker: deploy worker, Git clone, Docker/Nixpacks build, container runtime, Caddyfile generation
  • PostgreSQL + Redis via Docker Compose

Quick Start

cp .env.example .env
npm install
npm run prisma:generate
docker compose up -d
npm run prisma:migrate
npm run dev

Open http://localhost:3000.

Required local tools for real deployments

  • Docker Engine
  • Git
  • Nixpacks, only if using auto-detect mode
  • Caddy, if you want generated reverse proxy config to be reloaded

Create the Docker network once, or let worker create it:

docker network create cadsploy-net

GitHub OAuth and Auto Deploy Webhooks

Create a GitHub OAuth App and set:

GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
GITHUB_CALLBACK_URL=http://localhost:4000/auth/github/callback
GITHUB_WEBHOOK_SECRET=change-me-to-a-random-webhook-secret
PUBLIC_APP_URL=http://localhost:3000
API_URL=http://localhost:4000
NEXT_PUBLIC_API_URL=http://localhost:4000

When a project is created, Cadsploy tries to register a GitHub push webhook for that repository. Pushes to the configured branch trigger a new deployment automatically.

For local development, GitHub cannot deliver webhooks to localhost; expose the API with a tunnel such as ngrok/Cloudflare Tunnel and set API_URL plus GITHUB_CALLBACK_URL to the public HTTPS URL.

Database migrations

Migrations live in apps/api/prisma/migrations and are tracked in git — every clone/deploy target needs the same history to reach the same schema.

  • Schema changes must go through npm run prisma:migrate (prisma migrate dev), which writes a new migration file. Do not use prisma db push for anything you intend to ship — it edits the database without leaving a migration behind, so other environments silently drift out of sync.

  • To apply existing migrations to a fresh database (new environment, CI, first deploy on a server), run:

    npx prisma migrate deploy --schema apps/api/prisma/schema.prisma
  • CI runs migrate deploy against a throwaway Postgres on every push, so a broken or missing migration fails the build before it reaches a server.

MVP flow

  1. Login with GitHub.
  2. Import repository.
  3. Choose branch, build method, and app port.
  4. Click Deploy.
  5. Worker clones repo, builds Docker image, runs container, writes generated Caddyfile.
  6. Dashboard shows build/runtime logs.

Notes

  • Secrets are encrypted with ENCRYPTION_KEY using AES-256-GCM.
  • API endpoints enforce ownership checks.
  • Containers run with CPU/RAM limits and no-new-privileges.
  • This is an MVP scaffold; run it first in a private VPS/local lab before opening public access.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages