Installation
How the SlugBase monorepo is organized, what to install, and how production builds map to the running server.
What you need
- Git and Node.js (Dockerfile and CI use Node 20).
- Network access to run
npm installat the repository root (npm workspaces pullbackend,frontend,packages/core, andapps/selfhosted).
This repository is an npm workspace monorepo. Day-to-day commands run from the root package.json; production serving for self-hosting uses the slugbase-selfhosted workspace via npm run start.
Steps
Clone the repository
git clone https://github.com/mdg-labs/slugbase.git
cd slugbase
Install workspace dependencies
npm install
This installs dependencies for all workspaces declared in the root package.json.
Choose how you will run SlugBase
- Local development:
npm run devruns the backend and Vite frontend together (see Quick start). - Production on bare metal or a VM:
npm run buildthennpm run startafter you configure environment variables (see Configuration). - Production in Docker: build or use a container from the root
Dockerfile(see Docker and Docker Compose).
Build for production (when not using Docker)
npm run build
The root build script builds the backend, frontend, core embed assets, and copies outputs needed by the self-hosted app.
Start production server
npm run start
This runs npm run start in the slugbase-selfhosted workspace—the combined API and static UI for self-hosted deployments.
Verify
- After
npm run build, the tree underapps/selfhostedand packagedpublicassets should exist without build errors. - After
npm run start,GET /api/healthon your server port should return success (default port 5000 unless you setPORT).
A backend-only image is also available as Dockerfile.backend for API-only deployments (for example serverless or split frontends). Most self-hosters use the full Dockerfile that bundles the built SPA under public.
Troubleshooting
Related
Last updated 3 days ago
Built with Documentation.AI