- Node.js 20+ installed
- Docker & Docker Compose installed
- GitHub Personal Access Token with
repoandread:orgscopes
# Clone and navigate
git clone https://github.com/dpanshug/upstream-pulse.git
cd upstream-pulse
# Create environment file
cp .env.example .envEdit .env and add your credentials:
GITHUB_TOKEN=ghp_your_token_here
ORG_NAME=Your Organization Name# Install dependencies (root + backend + frontend)
npm run install:all
# Start Postgres, Redis, API, and Frontend
npm run devThis starts:
- Postgres on port 5433 (not 5432, to avoid local conflicts)
- Redis on port 6379
- API server on http://localhost:4321
- Frontend on http://localhost:5173
In a separate terminal, create the database tables (Postgres must be running first):
npm run db:migrateThis runs the SQL migration files to create all tables (projects, team_members, contributions, etc.) and indexes. You only need to run this once on initial setup, or again after pulling new migrations.
Note: Workers are not started by
npm run dev. To run background collection jobs, start the worker process separately (see Start Workers below).
# Health check
curl http://localhost:4321/health
# Ready check (includes database)
curl http://localhost:4321/ready
# List projects (empty at first)
curl http://localhost:4321/api/projectsIn a separate terminal:
cd backend
npm run workerThis starts the BullMQ workers (contribution collection, governance, leadership, team sync) and the cron scheduler.
To populate the database with sample projects and team members:
cd backend
npm run db:seedAdd team members via the API with their GitHub usernames. This enables identity resolution — contributions by these users will be counted as "team" contributions.
curl -X POST http://localhost:4321/api/team-members \
-H "Content-Type: application/json" \
-d '{"name": "Jane Doe", "githubUsername": "janedoe"}'You can also sync members automatically from a GitHub org (requires GITHUB_TEAM_TOKEN with read:org scope):
curl -X POST http://localhost:4321/api/admin/team-syncAdd upstream repositories to track via the API. Setting startCollection: true immediately queues a full history collection.
curl -X POST http://localhost:4321/api/projects \
-H "Content-Type: application/json" \
-d '{
"name": "My Project",
"githubOrg": "org-name",
"githubRepo": "repo-name",
"startCollection": true
}'If you added a project with startCollection: true, the worker is already collecting data. Check progress at http://localhost:5173 (dashboard) or:
curl http://localhost:4321/api/system/status | jq '.recentJobs[:3]'For existing projects, the daily sync runs automatically at 2 AM UTC. You can also trigger a manual collection:
curl -X POST http://localhost:4321/api/admin/collect \
-H "Content-Type: application/json" \
-d '{"projectId": "uuid-from-api-projects"}'If you prefer to start services individually instead of using npm run dev:
docker-compose up -d postgres redisWait for services to be healthy:
docker-compose pscd backend
npm installnpm run db:migratenpm run dev # This is the backend's dev script, not the root-level oneBackend should now be running on http://localhost:4321
cd backend
npm run workercd frontend
npm install
npm run devFrontend should now be running on http://localhost:5173
# Check PostgreSQL is running
docker-compose ps postgres
# Check logs
docker-compose logs postgres
# Restart if needed
docker-compose restart postgresMake sure you're using Node.js 20+ with ESM support:
node --version # Should be v20.x.x or higher# Check what's using port 4321
lsof -i :4321
# Kill the process or change PORT in .env
PORT=4322# Backend development (with hot reload)
cd backend
npm run dev
# Worker development (with hot reload)
cd backend
npm run worker
# Frontend development (with hot reload)
cd frontend
npm run dev
# Database studio (visual DB editor)
cd backend
npm run db:studio- Architecture — How the system works (data flow, schema, API reference)
- Workers & Jobs — Background job queues, schedules, and monitoring
- Adding an Org — How to add a new upstream org to track
- Contributing — Code contribution guidelines