- Node.js (v18+)
- Bun (latest)
- Docker & Docker Compose (for local database/redis)
PORT=3000
MONGODB_URI=mongodb://localhost:27017/formiq
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretREDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
SENDGRID_API_KEY=your_sendgrid_api_key
SUPPORT_EMAIL=your_verified_sender_email
FORM_SUBMISSION_TEMPLATE_ID=your_template_id
SUPPORT_TICKET_TEMPLATE_ID=your_template_idStart MongoDB and Redis using Docker Compose:
docker-compose up -dNavigate to the server directory, install dependencies, and start the development server:
cd server
bun install
bun run devThe server will start at http://localhost:3000.
Navigate to the workers directory, install dependencies, and start the worker process:
cd workers
bun install
bun run devTo build the SDK locally:
cd sdk
bun install
bun run buildYou can also run the entire stack using Docker. (Instructions to be added based on production docker-compose.yml if available).
1. MongoDB Connection Error
- Error:
MongoNetworkError: failed to connect to server - Solution: Ensure the MongoDB container is running (
docker ps). Check ifMONGODB_URIin.envmatches your Docker configuration (usuallymongodb://localhost:27017/formiqfor local dev).
2. Redis Connection Error
- Error:
ECONNREFUSED 127.0.0.1:6379 - Solution: Ensure Redis is running. If using Docker, make sure the port 6379 is exposed.
3. Emails Not Sending
- Symptom: Submission is successful, but no email arrives.
- Solution:
- Check Worker logs:
cd workers && bun run dev. - Verify
SENDGRID_API_KEYandSUPPORT_EMAILinworkers/.env. - Ensure the
FORM_SUBMISSION_TEMPLATE_IDis correct and active in SendGrid.
- Check Worker logs:
To run the test suite (if available):
# Server tests
cd server
bun test
# SDK tests
cd sdk
bun test