Skip to content

Repository files navigation

CoFoundry

Find collaborators who actually build what you build. CoFoundry connects your GitHub profile, builds a project knowledge graph, and matches you with founders on overlapping repos, stacks, and ideas — with AI-generated collaboration insights.

Features

  • GitHub-powered onboarding — Import repos; your graph is built from real projects, not manual tags.
  • Interactive knowledge graph — Explore projects as a force-directed bubble map on the dashboard.
  • Smart matching — Semantic similarity over project nodes (OpenAI embeddings) plus cached AI insights (Claude).
  • Integrations — GitHub OAuth for import/sync; LinkedIn OAuth scaffold for future profile enrichment.
  • Match cache — Fingerprints and TTLs reduce repeat LLM calls for matches and insights.

Tech stack

LayerStack
FrontendReact 18, Vite, Tailwind CSS, Zustand, react-force-graph-2d
BackendNode.js, Express, TypeScript
DatabaseSupabase (Postgres + Auth)
AIAnthropic Claude (insights), OpenAI (embeddings)

Project structure

plugandplay/
├── frontend/ # React app (port 5173 dev / nginx in Docker)
├── backend/ # Express API (port 3001)
├── supabase/
│ └── migrations/ # SQL schema
├── docker-compose.yml # Run full stack in containers
├── migrate.js # Run migrations against Supabase
├── .env.example # Root env reference
└── package.json # Dev scripts (concurrently)

Prerequisites

Quick start

1. Clone and install

git clone <your-repo-url>cd plugandplay
npm run install:all

2. Environment variables

Copy the example files and fill in your values:

cp .env.example backend/.env
cp frontend/.env.example frontend/.env

Backend (backend/.env):

VariableDescription
SUPABASE_ENVTEST (local) or PROD (production/GCP); defaults to TEST unless NODE_ENV=production
SUPABASE_URL_PRODSupabase project URL (production)
SUPABASE_ANON_KEY_PRODAnon/public key (production)
SUPABASE_SERVICE_ROLE_KEY_PRODService role key (server only, production)
SUPABASE_URL_TEST / SUPABASE_ANON_KEY_TEST / SUPABASE_SERVICE_ROLE_KEY_TESTTest project (optional; leave empty)
SUPABASE_DATABASE_URL_PRODFull Postgres URI for npm run db:migrate (Session pooler from Supabase → Database)
SUPABASE_DATABASE_URL_TESTTest DB URI (optional; leave empty)
SUPABASE_DB_PROD_PASSWORDLegacy fallback if URL is not set (optional)
SUPABASE_DB_TEST_PASSWORDTest DB password legacy fallback (optional)
ANTHROPIC_API_KEYClaude API key
OPENAI_API_KEYEmbeddings for matching
GITHUB_CLIENT_ID_PROD / GITHUB_CLIENT_SECRET_PRODGitHub OAuth (production)
GITHUB_CLIENT_ID_TEST / GITHUB_CLIENT_SECRET_TESTGitHub OAuth (local / SUPABASE_ENV=TEST)
SENDGRID_API_KEY / SENDGRID_FROM_EMAILEmail invites for external GitHub users
FRONTEND_URLe.g. http://localhost:5173
APP_URLe.g. http://localhost:3001

Frontend (frontend/.env):

VariableDescription
VITE_SUPABASE_ENVTEST (local) or PROD (production build); defaults to TEST in dev, PROD in Vite production builds
VITE_SUPABASE_URL_PRODSame as backend SUPABASE_URL_PROD
VITE_SUPABASE_ANON_KEY_PRODSame as backend SUPABASE_ANON_KEY_PROD
VITE_SUPABASE_URL_TEST / VITE_SUPABASE_ANON_KEY_TESTTest project (optional; leave empty)
VITE_API_URLBackend URL, e.g. http://localhost:3001
VITE_AUTH_REDIRECT_URLOptional; default {origin}/auth/callback
VITE_WS_BASE_URLOptional WS base URL override for project chat
VITE_PROD_WS_BASE_URLProduction WebSocket base URL for project chat, e.g. wss://api.cofoundry.app (dev defaults to ws://localhost:3001)

Sign in / sign up with GitHub (Supabase Auth)

  1. Supabase → AuthenticationProviders → enable GitHub and paste your GitHub OAuth app Client ID & Secret.
  2. GitHub OAuth app → Authorization callback URL:
    https://voxxnyznweutlmrlgqmy.supabase.co/auth/v1/callback
  3. Supabase → AuthenticationURL Configuration → add redirect URLs, e.g.
    http://localhost:5173/auth/callback (and your production URL when deployed).

GitHub OAuth (repo import — separate app or same app with a second callback):
http://localhost:3001/api/integrations/github/callback

Never commit .env files — they are listed in .gitignore.

3. Database migrations

npm run db:migrate

4. Run locally

npm run dev

Run with Docker

The stack runs as two containers: backend (Node API) and frontend (nginx serving the Vite build and proxying /api to the backend).

1. Configure env files

cp backend/.env.example backend/.env
# Fill in Supabase, Anthropic, OpenAI, GitHub OAuth, etc.
cp docker-compose.env.example .env
# Set VITE_SUPABASE_URL_PROD and VITE_SUPABASE_ANON_KEY_PROD (same values as frontend/.env)

For Docker, set OAuth URLs in backend/.env:

VariableDocker local value
FRONTEND_URLhttp://localhost:8080
APP_URLhttp://localhost:3001

GitHub OAuth callback (unchanged — hits the API directly):
http://localhost:3001/api/integrations/github/callback

2. Migrations (still on the host)

Docker does not run migrations. Apply schema once against Supabase:

npm run db:migrate

3. Start containers

npm run docker:up
# or: docker compose up --build

Stop: npm run docker:down

Deploy on Google Cloud

GitHub Actions deploys to Cloud Run on every push to main (project cofoundry-497002).

One-time setup:

./infra/gcp/setup.sh # APIs, Artifact Registry, Secret Manager
./infra/gcp/sync-secrets.sh # upload local .env → Secret Manager
./infra/gcp/setup-github-actions.sh # create SA → add GCP_SA_KEY in GitHub repo secrets

See infra/gcp/GITHUB_ACTIONS.md. Manual deploy: gcloud builds submit --config=cloudbuild.yaml --project=cofoundry-497002 .

Deploy runs DB migrations via SUPABASE_DATABASE_URL_PROD (full Session pooler URI from Supabase → DatabaseConnection string). Add it to backend/.env, then run ./infra/gcp/sync-secrets.sh.

Full docs: infra/gcp/README.md · Domain: cofoundry.appinfra/gcp/DOMAIN.md

Scripts

CommandDescription
npm run devStart frontend + backend
npm run dev:frontendVite dev server only
npm run dev:backendAPI with hot reload
npm run buildProduction build
npm run db:migrateApply Supabase SQL migrations
npm run docker:upBuild and start Docker Compose stack
npm run docker:downStop containers
npm run docker:buildBuild images without starting

Security notes

  • Keep SUPABASE_SERVICE_ROLE_KEY_PROD, OAuth secrets, and API keys only in local .env files or your deployment platform’s secret store.
  • Use .env.example files as templates; do not put real secrets in the repo.
  • The service role key must never be exposed to the browser — only VITE_* public Supabase keys belong in the frontend.

License

Private — all rights reserved unless otherwise specified.

About

Find collaborators from your GitHub projects — knowledge graph matching with AI insights.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages