- name
- connectify
- description
- Build, debug, and extend the Connectify founder network platform (React/Vite frontend + Express backend + Redis cache + OpenAI ranking + Apify ingestion). Use when working in this repository to run local development, modify
/api/query, tune scoring and suggested actions, replace placeholder connection ingestion with real Apify actor calls, or troubleshoot frontend/backend data flow.
Connectify Development Guide
Set up the project
- Install dependencies:
npm install- Create
.envfrom.env.exampleand set:
- OPENAI_API_KEY - REDIS_URL - APIFY_TOKEN - optional OPENAI_MODEL, PORT
- Start Redis before running the backend.
Run the app
Prefer single-service mode when validating full user flows (dashboard + chat + API):
npm run build
npm startOpen http://localhost:3001.
Use split mode only when focusing on one side:
- Frontend only:
npm run dev - Backend only:
npm run dev:server
Use the file map
server.js: Express API, Redis seeding,/api/query, static hosting ofdist/.agent.js: OpenAI relevance scoring and follow-up action generation.redis.js: Redis connection lifecycle, connection storage, query-context cache (30 min TTL).apify.js: Connection ingestion adapter (currently placeholder dataset).src/components/AIChatPanel.jsx: chat UX and/api/queryclient call.src/data/placeholders.js: dashboard placeholder cards/lists/map seed data.
Preserve the backend response contract
Return this shape from /api/query:
{
"results": [
{
"name": "string",
"role": "string",
"company": "string",
"platforms": ["string"],
"relevanceScore": 0,
"reason": "string",
"suggestedActions": ["string", "string"]
}
]
}If changing fields, update both server.js and src/components/AIChatPanel.jsx together.
Implement real Apify ingestion
When replacing the stub in apify.js:
- Keep output normalized to this connection schema:
- id, name, role, company, location, platforms, tags, lastInteraction, notes
- Keep IDs stable and unique to prevent duplicate Redis records.
- Return an array compatible with
saveConnection(connection.id, connection). - Keep actor/network logic isolated in
apify.js; avoid spreading Apify-specific code throughserver.js.
Tune AI behavior safely
When editing agent.js:
- Keep
response_format: { type: 'json_object' }. - Keep strict parsing and fallback handling (
safeJsonParse, bounded score 0-100). - Keep deterministic-ish scoring temperature low and action generation temperature moderate.
- Preserve fallback actions in
server.jsif action generation fails.
Validate changes quickly
- Build frontend:
npm run build- Start server:
npm start- Smoke test query endpoint:
curl -X POST http://localhost:3001/api/query \
-H "Content-Type: application/json" \
-d "{\"query\":\"Who in my network works in AI and is based in SF?\",\"sessionId\":\"local-test-session\"}"- Confirm the response includes ranked
resultsand cached repeat requests return quickly.
Watch for common pitfalls
npm run devserves only frontend;/api/querywill not work there unless a proxy/backend is also configured.server.jsCORS currently allowshttp://localhost:3000; adjust if using different local origins.redis.jsuseskeys('connection:*'); avoid very large production datasets without pagination/scans.- Do not commit secrets from
.envor hardcode API tokens.