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 20 or later.
- Internet access to download dependencies when running
npm install.
All commands below run from the repository root. Production serving runs via npm run start.
Steps
Clone the repository
git clone https://github.com/mdg-labs/slugbase.git
cd slugbase
Install dependencies
npm install
Choose how you will run SlugBase
- Local development:
npm run devruns the backend and frontend together (see Quick start). - Production (no Docker):
npm run buildthennpm run startafter setting up environment variables (see Configuration). - Production with Docker: use the ready-made
docker-compose.ymlfrom Docker Compose—no git clone needed—or see Docker for single-container options.
Build for production (when not using Docker)
npm run build
Start the production server
npm run start
The server runs on port 5000 by default and serves both the API and the web UI.
Verify
- After
npm run build, the build should complete without errors. - After
npm run start, openhttp://localhost:5000/api/health— a successful response means the server is up.
A backend-only image (Dockerfile.backend) is available for API-only deployments. Most users should use the main Dockerfile or the Docker Compose setup, which includes the full web UI.
Troubleshooting
Use a supported Node version (see Node 20 above), delete node_modules only inside the repo if needed, and re-run npm install from the repository root so workspaces resolve correctly.
The backend validates JWT_SECRET, ENCRYPTION_KEY, and production SESSION_SECRET before listening. Generate long random values and set NODE_ENV=production only when you intend to run in production mode. Details: Configuration.
Related
Last updated 1 week ago
Built with Documentation.AI