A Next.js web application that helps job seekers get personalized LinkedIn referral requests by matching them with people at their target company based on shared background, interests, and experiences.
- 🔐 User Authentication: Sign in with Google OAuth or email/password
- 📝 Comprehensive Profile Questionnaire: Multi-step form to build detailed user profiles
- 🤖 AI-Powered Matching: Uses OpenAI/Grok to find potential referrers based on commonalities
- 🎯 Smart Referral Suggestions: Generates personalized outreach messages
- 🔍 Job Scraping: Automatically extract job details from LinkedIn, Indeed, and other job boards
- 📊 Dashboard: Track your searches and referral matches
- 📱 Responsive Design: Beautiful UI with Tailwind CSS
- Frontend: Next.js 14, React, TypeScript
- Styling: Tailwind CSS
- Authentication: NextAuth.js with Google OAuth
- Database: MongoDB with Mongoose
- AI: OpenAI API / Grok API
- Form Validation: React Hook Form + Zod
- Job Scraping: Cheerio
- Deployment: Vercel-ready
- Node.js 18+ and npm/yarn/pnpm
- MongoDB database (local or MongoDB Atlas)
- OpenAI API key or Grok API key
- Google OAuth credentials (optional, for Google sign-in)
- Clone the repository
git clone <your-repo-url>
cd referral-finder- Install dependencies
npm install
# or
yarn install
# or
pnpm install- Set up environment variables
Create a .env.local file in the root directory:
cp env.example .env.localEdit .env.local with your credentials:
# MongoDB
MONGODB_URI=mongodb://localhost:27017/referral-finder
# or MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/referral-finder
# NextAuth
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-here
# Google OAuth (optional)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# OpenAI API (or use XAI_API_KEY for Grok)
OPENAI_API_KEY=your-openai-api-key
# XAI_API_KEY=your-grok-api-key- Generate NextAuth Secret
openssl rand -base64 32Copy the output and use it as your NEXTAUTH_SECRET.
- Set up Google OAuth (Optional)
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google+ API
- Go to Credentials → Create Credentials → OAuth 2.0 Client ID
- Add authorized redirect URI:
http://localhost:3000/api/auth/callback/google - Copy Client ID and Client Secret to
.env.local
- Set up MongoDB
Option 1: Local MongoDB
# Install MongoDB locally or use Docker
docker run -d -p 27017:27017 --name mongodb mongoOption 2: MongoDB Atlas
- Sign up at MongoDB Atlas
- Create a free cluster
- Get your connection string and add it to
.env.local
- Run the development server
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 to see the app.
- Users can sign up with email/password or Google OAuth
- First-time users are redirected to the profile questionnaire
- Multi-step form collecting:
- Basic demographics (age, gender, ethnicity, nationality, location)
- Personal background (childhood, family, life events)
- Education history
- Work experience
- Personal life (hobbies, interests, personality traits)
- Additional details (languages, travel, volunteer work, awards)
- LinkedIn profile URL (required)
- View recent searches and stats
- Search for referrals by:
- Pasting a job URL (auto-scrapes details)
- Manually entering job details
- AI analyzes your profile and the job description
- Searches for people at the target company who:
- Share your ethnicity, nationality, or background
- Attended the same school
- Have similar interests or hobbies
- Work in related roles
- Share other commonalities
- See 5-10 potential referrers with:
- Their LinkedIn profile link
- Why they're relevant
- Shared commonalities
- Personalized outreach message
- Copy messages to send via LinkedIn (manual sending only)
referral-finder/
├── app/
│ ├── api/
│ │ ├── auth/
│ │ │ ├── [...nextauth]/route.ts # NextAuth configuration
│ │ │ └── register/route.ts # User registration
│ │ ├── profile/route.ts # Profile management
│ │ ├── referrals/
│ │ │ ├── route.ts # Referral matching
│ │ │ └── [id]/route.ts # Get specific search
│ │ └── jobs/scrape/route.ts # Job scraping
│ ├── auth/
│ │ ├── signin/page.tsx # Sign in page
│ │ └── signup/page.tsx # Sign up page
│ ├── dashboard/page.tsx # Main dashboard
│ ├── questionnaire/page.tsx # Profile questionnaire
│ ├── search/[id]/page.tsx # Search detail view
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Landing page
│ ├── providers.tsx # Session provider
│ └── globals.css # Global styles
├── components/
│ ├── JobSearchForm.tsx # Job search component
│ └── ReferralResults.tsx # Display referral matches
├── lib/
│ └── mongodb.ts # MongoDB connection
├── models/
│ ├── User.ts # User schema
│ └── JobSearch.ts # Job search schema
├── types/
│ └── next-auth.d.ts # NextAuth types
├── middleware.ts # Auth middleware
├── tailwind.config.ts # Tailwind configuration
├── next.config.js # Next.js configuration
└── package.json # Dependencies
-
Push your code to GitHub
-
Import project to Vercel
- Go to Vercel
- Click "New Project"
- Import your GitHub repository
-
Add environment variables
- Add all variables from
.env.localto Vercel - Don't forget to update
NEXTAUTH_URLto your production URL
- Add all variables from
-
Update Google OAuth redirect URI
- Add
https://yourdomain.com/api/auth/callback/googleto Google Console
- Add
-
Deploy!
- Vercel will automatically build and deploy your app
Make sure to set these in Vercel:
MONGODB_URI=<your-mongodb-atlas-uri>
NEXTAUTH_URL=https://yourdomain.com
NEXTAUTH_SECRET=<your-secret>
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>
OPENAI_API_KEY=<your-openai-key>
- Manual Sending Only: This app provides suggested messages that users must manually copy and send via LinkedIn
- No Automation: We do NOT automate sending messages to comply with LinkedIn's Terms of Service
- Educational Purpose: Users should use this tool responsibly and respectfully
The app supports both OpenAI and Grok:
Using OpenAI (default):
OPENAI_API_KEY=your-openai-keyUsing Grok:
XAI_API_KEY=your-grok-keyThe code automatically detects which API key is available.
- User data is stored securely in MongoDB
- Passwords are hashed with bcrypt
- Profile data is only used for referral matching
- No data is shared with third parties
Edit /app/api/referrals/route.ts to customize how the AI finds and matches referrers.
- Update
/models/User.tsschema - Add fields to
/app/questionnaire/page.tsx - Update the AI prompt in
/app/api/referrals/route.ts
- Modify
/app/globals.cssfor global styles - Update
/tailwind.config.tsfor theme colors - Edit component styles directly
# Make sure MongoDB is running
docker ps # Check if MongoDB container is running
# Test connection
mongosh mongodb://localhost:27017/referral-finder# Regenerate secret
openssl rand -base64 32
# Clear browser cookies and try again# Clear Next.js cache
rm -rf .next
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm installContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
For questions or issues:
- Open a GitHub issue
- Check existing documentation
- Review the code comments
- Built with Next.js and React
- AI powered by OpenAI/Grok
- UI components with Tailwind CSS
- Authentication with NextAuth.js
Remember: This tool is meant to facilitate genuine networking. Always be respectful and personal in your outreach!