Prerequisites:
- Node.js version 18 or higher
- npm or yarn package manager
- MongoDB database
- ngrok for webhook development
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
- Schema Changes: Always use Prisma migrations for schema changes
- Seeding: Create seed scripts for consistent test data
- Studio: Use
npx prisma studiofor database inspection
API Development
- Type Safety: Use TypeScript interfaces for API requests/responses
- Error Handling: Implement consistent error handling patterns
- Authentication: Test with different user roles (Admin, Interviewer, Candidate)
Testing Workflow
- Manual Testing: Test all user roles and permissions
- AI Features: Ensure OpenAI API key is working for AI evaluations
- Webhooks: Test webhook integrations with ngrok
- Code Editor: Test the CodeMirror integration with different programming languages
Troubleshooting
Database Connection Issues
Database Connection Issues
- Verify your
DATABASE_URLin.env - Ensure MongoDB is running locally or accessible
- Check network connectivity for cloud databases
- Run
npx prisma db pushto sync schema
Authentication Not Working
Authentication Not Working
- Verify Clerk environment variables are set correctly
- Check webhook URL in Clerk dashboard matches ngrok URL
- Ensure HTTPS is used for webhook URLs
- Check Clerk webhook secret matches
.envvalue
AI Features Not Working
AI Features Not Working
- Verify OpenAI API key is valid and has credits
- Check API key permissions for the models you’re using
- Monitor OpenAI API usage in your dashboard
- Check network connectivity to OpenAI services
Code Editor Issues
Code Editor Issues
- Clear browser cache and reload
- Check browser console for JavaScript errors
- Test with different browsers
- Verify CodeMirror themes and modes are loading