Complete guide to setting up the Sarva development environment.
Ensure you have the following installed:
- Node.js: v18.x or higher
- npm: v9.x or higher
- Docker: v24.x or higher
- Docker Compose: v2.x or higher
- Git: v2.x or higher
Optional but recommended:
- Kubernetes: Minikube or Docker Desktop
- Python: 3.11+ (for Python services)
- Go: 1.21+ (for Go services)
git clone https://github.com/YOUR_ORG/sarva.git
cd sarvanpm installThis will install dependencies for all workspaces in the monorepo.
Create environment files:
cp .env.example .envEdit .env with your local configuration:
# Database
DATABASE_URL=postgresql://sarva:sarva123@localhost:5432/sarva_dev
REDIS_URL=redis://localhost:6379
MONGODB_URL=mongodb://sarva:sarva123@localhost:27017/sarva_dev
# JWT
JWT_SECRET=your-super-secret-jwt-key-change-this
JWT_EXPIRATION=7d
# AWS/S3 (using MinIO locally)
AWS_ACCESS_KEY_ID=sarva
AWS_SECRET_ACCESS_KEY=sarva123456
AWS_S3_BUCKET=sarva-dev
AWS_REGION=us-east-1
AWS_S3_ENDPOINT=http://localhost:9000
# External APIs
TWILIO_ACCOUNT_SID=your-twilio-sid
TWILIO_AUTH_TOKEN=your-twilio-token
SENDGRID_API_KEY=your-sendgrid-key
# Linear Integration
LINEAR_API_KEY=your-linear-api-key
LINEAR_TEAM_ID=your-team-idStart PostgreSQL, Redis, MongoDB, RabbitMQ, and other services:
npm run docker:upVerify services are running:
docker psRun migrations:
npm run migrateSeed initial data (optional):
npm run seedStart all services in development mode:
npm run devThis will start:
- API Gateway: http://localhost:8000
- Web App: http://localhost:3000
- Admin Dashboard: http://localhost:3001
- All microservices
Open your browser:
- Web App: http://localhost:3000
- API Docs: http://localhost:8000/docs
- Admin: http://localhost:3001
cd apps/mobile
# iOS
npm run ios
# Android
npm run androidStart a specific service:
# Auth service
npm run dev:auth
# Messaging service
npm run dev:messaging
# Wallet service
npm run dev:walletIf ports are in use, stop conflicting services:
# Find process using port
lsof -ti:3000
# Kill process
kill -9 <PID>Reset database:
npm run docker:down
npm run docker:up
npm run migrateClean install:
rm -rf node_modules package-lock.json
npm installInstall recommended extensions:
- ESLint
- Prettier
- TypeScript
- Docker
- GitLens
Settings are in .vscode/settings.json
- Open project
- Enable Node.js integration
- Configure ESLint and Prettier
- Set TypeScript version to workspace
Run tests:
# All tests
npm test
# Unit tests
npm run test:unit
# Integration tests
npm run test:integration
# E2E tests
npm run test:e2e
# With coverage
npm run test:coverage- Get your Linear API key from https://linear.app/settings/api
- Add to
.env:LINEAR_API_KEY=your-key - Configure webhook in Linear settings
- Point webhook to:
https://your-domain.com/webhooks/linear
- Install Linear GitHub app
- Connect repositories
- Use commit format:
feat(scope): message SAR-123 - PRs will auto-link to Linear issues
- Read Development Guide
- Review Architecture
- Check API Documentation
- Join team Slack workspace
- Slack: #dev-help
- Email: dev-team@sarva.app
- GitHub Issues: Report bugs
- Linear: Track features
Happy coding! 🚀