Skip to main content
Prerequisites:
  • Node.js version 18 or higher
  • npm or yarn package manager
  • MongoDB database
  • ngrok for webhook development
Complete guide for setting up FeedbackAI development environment and workflow.

Development Workflow

1

Clone and Setup

2

Environment Configuration

Create a .env file with required environment variables:
3

Database Setup

Initialize your database with Prisma:
Optionally seed with test data:
4

Start Development

Start the development server:
The application will be available at http://localhost:3000.

Webhook Development

For features requiring webhooks (Clerk authentication, etc.), use ngrok:

Setting up ngrok

Update Webhook URLs

Copy the HTTPS URL from ngrok and update:
  • Clerk Dashboard: Set webhook URL to https://your-ngrok-url.ngrok.io/api/webhooks/clerk
  • Update any other webhook endpoints in your external services

Available Scripts

FeedbackAI includes several npm scripts for development:

Project Structure

Understanding the codebase organization:

Development Best Practices

Code Formatting

We recommend these VSCode extensions:
  • ESLint: For code linting and error detection
  • Prettier: For code formatting
  • Prisma: For database schema syntax highlighting
  • TypeScript: Built-in TypeScript support

Database Development

  1. Schema Changes: Always use Prisma migrations for schema changes
  2. Seeding: Create seed scripts for consistent test data
  3. Studio: Use npx prisma studio for database inspection

API Development

  1. Type Safety: Use TypeScript interfaces for API requests/responses
  2. Error Handling: Implement consistent error handling patterns
  3. Authentication: Test with different user roles (Admin, Interviewer, Candidate)

Testing Workflow

  1. Manual Testing: Test all user roles and permissions
  2. AI Features: Ensure OpenAI API key is working for AI evaluations
  3. Webhooks: Test webhook integrations with ngrok
  4. Code Editor: Test the CodeMirror integration with different programming languages

Troubleshooting

  1. Verify your DATABASE_URL in .env
  2. Ensure MongoDB is running locally or accessible
  3. Check network connectivity for cloud databases
  4. Run npx prisma db push to sync schema
  1. Verify Clerk environment variables are set correctly
  2. Check webhook URL in Clerk dashboard matches ngrok URL
  3. Ensure HTTPS is used for webhook URLs
  4. Check Clerk webhook secret matches .env value
  1. Verify OpenAI API key is valid and has credits
  2. Check API key permissions for the models you’re using
  3. Monitor OpenAI API usage in your dashboard
  4. Check network connectivity to OpenAI services
  1. Clear browser cache and reload
  2. Check browser console for JavaScript errors
  3. Test with different browsers
  4. Verify CodeMirror themes and modes are loading

Environment Variables Reference

Complete list of environment variables needed for development: