Thank you for your interest in contributing to AstraDraw! This guide will help you set up your local development environment.
- Node.js 18+
- Yarn 1.22+ (for frontend)
- npm 9+ (for backend)
- Docker and Docker Compose
- Git
- just (command runner) -
brew install justor see just installation
AstraDraw consists of multiple repositories:
| Repository | Description | Local Folder |
|---|---|---|
| astradraw | Main orchestration (this repo) | / |
| astradraw-app | React frontend (Excalidraw fork) | frontend/ |
| astradraw-api | NestJS backend API | backend/ |
| astradraw-room | WebSocket server | room-service/ |
git clone https://github.com/AstraDraw/astradraw.git
cd astradraw# Frontend (Excalidraw fork)
git clone https://github.com/AstraDraw/astradraw-app.git frontend
# Backend (NestJS API)
git clone https://github.com/AstraDraw/astradraw-api.git backend
# Room service (WebSocket)
git clone https://github.com/AstraDraw/astradraw-room.git room-servicecd deploy
# Copy environment template
cp env.example .env
# Create secrets directory and required secrets
mkdir -p secrets
# Database credentials
echo "excalidraw" > secrets/postgres_user
openssl rand -base64 32 > secrets/postgres_password
echo "excalidraw" > secrets/postgres_db
# JWT secret
openssl rand -base64 32 > secrets/jwt_secret
# MinIO credentials
echo "minioadmin" > secrets/minio_access_key
openssl rand -base64 32 > secrets/minio_secret_key
# Create self-signed certificates for local HTTPS
mkdir -p certs
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout certs/server.key -out certs/server.crt \
-subj "/CN=localhost"
# Enable local builds
cp docker-compose.override.yml.disabled docker-compose.override.ymlNote: See Docker Secrets Documentation for complete secrets management guide.
Recommended: Use just commands (from project root):
cd .. # Back to astradraw root
# Start all services with hot-reload
just dev
# Check status
just dev-status
# Stop everything
just dev-stopAlternative: Docker Compose directly:
# From the deploy/ folder
docker compose up -d --build
# View logs
docker compose logs -f app # Frontend logs
docker compose logs -f api # Backend logsOpen https://localhost in your browser (accept the self-signed certificate warning).
# Daily development
just dev # Start everything with hot-reload
just dev-status # Check what's running
just dev-stop # Stop everything
# Code checks (run before commits!)
just check-all # All checks (frontend + backend + room)
just check-frontend # TypeScript + Prettier + ESLint
just check-backend # Build + Prettier + ESLint
# Git status across all repos
just status # Show git status for all reposcd frontend
yarn install
yarn start # Development server on http://localhost:5173Before committing:
just check-frontend
# Or manually:
yarn test:typecheck # TypeScript type checking
yarn test:other # Prettier formatting
yarn test:code # ESLint code qualitycd backend
npm install
npm run start:dev # Development server with hot reloadBefore committing:
just check-backend
# Or manually:
npm run build # Build (includes TypeScript)
npm run format # Prettier formatting
npm run lint # ESLint code qualityThe room service is typically used as-is from upstream. If you need to modify it:
cd room-service
yarn install
yarn start:devcd frontend
yarn test:all # Run all checks + unit testscd backend
npm run test # Unit tests
npm run test:e2e # End-to-end testscd deploy
# Standard services
docker compose up -d
# With admin tools (pgAdmin, MinIO Console)
docker compose --profile admin up -d
# With OIDC testing (Dex)
docker compose --profile oidc up -dCreate branches in all affected repositories with the same name:
# Check git status first
just status
# If changing frontend
cd frontend
git checkout -b feature/my-feature
# If changing backend
cd backend
git checkout -b feature/my-featureFollow the patterns documented in:
- docs/architecture/ARCHITECTURE.md - Technical architecture
- docs/features/ - Feature documentation
# Run all checks
just check-all
# Test with Docker
just fresh-dev # Fresh start with local buildsUse descriptive commit messages (these will be used for changelog at release):
# Frontend
cd frontend
git add -A
git commit -m "feat(workspace): add auto-save functionality
- Added debounced save on canvas changes
- Shows save indicator in toolbar
- Handles offline/online transitions"
git push origin feature/my-feature
# Backend (if changed)
cd backend
git add -A
git commit -m "feat(api): add scene versioning endpoint"
git push origin feature/my-featureCreate PRs in each affected repository. Link related PRs in the description.
We use conventional commits:
type(scope): description
[optional body with details]
Types:
feat:- New featurefix:- Bug fixdocs:- Documentationrefactor:- Code refactoringtest:- Adding testschore:- Maintenance
Examples:
feat(workspace): add auto-save functionality
fix(auth): resolve JWT cookie not being sent
docs: update API documentation
refactor(collab): simplify room key encryption
- Use functional components with hooks
- Use Jotai for shared state
- Add translations to both
en.jsonandru-RU.json - Stop keyboard event propagation in input fields:
onKeyDown={(e) => e.stopPropagation()}
- Use Prisma for database operations
- JWT guard is at
auth/jwt.guard.ts - Use
@types/multerfor file uploads - Use
getSecret()/getSecretOrThrow()for Docker secrets
- Check existing documentation in
docs/- Architecture - System overview
- Docker Secrets - Secure credential management
- Workspace & Auth - Authentication details
- Full documentation index
- Look at similar features for patterns
- Open an issue for questions
By contributing, you agree that your contributions will be licensed under the MIT License.