Quick Start
Prerequisites
Before you begin, make sure you have the following installed:
| Tool | Minimum version | Check |
|---|---|---|
| Node.js | 20+ | node --version |
| pnpm | latest | pnpm --version |
| Docker | latest | docker --version |
You also need access to the Primebrick GitHub repositories.
1. Clone the repositories
Primebrick is split into several repos. For a full local environment you need at minimum the backend and frontend:
Code
If you plan to develop microservices or shared libraries, also clone:
Code
2. Start infrastructure with Docker
The backend repo includes a docker-compose.yml that spins up PostgreSQL, Casdoor, and NATS:
Code
This starts:
- PostgreSQL — primary database
- Casdoor — identity provider (OIDC / OAuth2)
- NATS — messaging bus for microservice communication
3. Install dependencies
Install dependencies for the backend and frontend:
Code
4. Set up Casdoor
Primebrick includes a setup script that configures Casdoor with the default application, organizations, and roles:
Code
This provisions the OIDC client and seed users needed for local development.
5. Run database migrations
Apply the database schema migrations:
Code
6. Start the development servers
Start the backend and frontend in separate terminals:
Code
Code
Where things run
| Service | URL |
|---|---|
| Backend API | http://localhost:3001 |
| Frontend (SvelteKit) | http://localhost:5173 |
| Casdoor console | http://localhost:8000 |
| NATS | nats://localhost:4222 |
Verify it works
- Open
http://localhost:5173in your browser — you should see the Primebrick frontend. - Check the backend health at
http://localhost:3001/api/v1/health. - View the aggregated OpenAPI spec at
http://localhost:3001/api/v1/openapi/aggregated.json.
Troubleshooting
Docker containers won't start
Make sure ports 5432 (PostgreSQL), 8000 (Casdoor), and 4222 (NATS) are not already in use. Stop any conflicting services or adjust the port mappings in docker-compose.yml.
Casdoor setup script fails
Ensure the Casdoor container is fully up before running pnpm run setup:casdoor. Check with docker compose ps and wait until the Casdoor service shows a healthy state.
Database migration errors
Confirm PostgreSQL is running and the connection string in your .env file points to the Dockerized instance. Run pnpm run db:migrate again after fixing the connection.
Next steps
- Architecture — understand how the pieces fit together.
- API Overview — learn about the REST API.