Appearance
Backend Setup
This guide covers the essential setup steps for the Jubiloop backend when running in host-mode (infrastructure in Docker, applications on your machine).
For the recommended Docker Stack workflow where everything runs in Docker, see Local Development Setup.
Prerequisites
- Node.js 24+ installed
- Docker running (for local PostgreSQL and Redis)
- Access to the monorepo
Initial Setup
1. Install Dependencies
From the project root:
bash
npm install2. Environment Configuration
Copy the example environment file:
bash
cp apps/server/.env.example apps/server/.envThen fill in the required values in apps/server/.env:
| Variable | How to get it |
|---|---|
APP_KEY | cd apps/server && node ace generate:key |
BETTER_AUTH_SECRET | cd apps/server && node ace generate:key |
HEALTH_SECRET | cd apps/server && node ace generate:key |
REDIS_PASSWORD | From 1Password vault |
RESEND_API_KEY | From 1Password vault |
BREVO_API_KEY | From 1Password vault |
Docker Stack overrides
If you use the Docker Stack, DB_HOST and REDIS_HOST are automatically overridden to the container names. You only need to set the secret values above.
3. Database Setup
Run Migrations
bash
# From project root
npm run migration:run
# Or from server directory
cd apps/server
node ace migration:runSeed Database (Optional)
For development, you can seed the database with sample data:
bash
# From server directory
cd apps/server
node ace db:seed4. Start the Server
Recommended: use the Docker Stack
bash
npm run dev:stack:upAPI available at: https://api.jubiloop.localhost
See Local Development Setup for the full guide.
Alternative: run on host (infra-only mode)
Requires infrastructure services to be running first:
bash
cd infra/local_dev && docker compose -f docker-compose.infra.yml up -dThen start the server:
bash
# From project root
npm run dev -- --filter=server
# Or from server directory
cd apps/server
node ace serve --hmrAvailable at: http://localhost:3333
Common Tasks
Creating a New Migration
bash
cd apps/server
node ace make:migration create_table_nameRolling Back Migrations
bash
cd apps/server
node ace migration:rollbackForbidden
migration:rollback --batch=0 drops every table in the database. It is explicitly prohibited. Use migration:fresh to reset locally.
Accessing the Database
Docker Stack:
bash
docker exec -it jubiloop_dev_postgres psql -U postgres -d jubiloop_dev_dbInfra-only mode:
bash
docker exec -it jubiloop_local_dev_postgres psql -U postgres -d jubiloop_dev_dbGUI tools (both modes): localhost:5433, user: postgres, password: postgres, database: jubiloop_dev_db
Checking Server Health
bash
curl http://localhost:3333/healthTroubleshooting
Port Already in Use
If port 3333 is already in use:
- Check what's using it:
lsof -i :3333 - Change the port in your
.envfile - Restart the server
Database Connection Failed
Docker Stack:
bash
docker logs jubiloop_dev_postgresInfra-only:
bash
docker logs jubiloop_local_dev_postgresVerify DB_HOST=localhost and DB_PORT=5433 in your .env file.
Redis Connection Failed
Docker Stack: docker logs jubiloop_dev_redis
Infra-only: docker logs jubiloop_local_dev_redis
Verify REDIS_HOST=localhost and REDIS_PORT=6379 in your .env file.
Next Steps
- Review AdonisJS Commands for CLI reference
- Check Controllers & Routing for API development
- See Data Models for database schema
- Read API Reference for endpoint documentation