A full-stack web application that revolutionizes job matching by combining AI-powered skill extraction with Web3 blockchain payment integration. Find your perfect job match with intelligent NLP-based scoring and pay/receive securely through the Polygon network.
- Features
- Architecture
- Tech Stack
- Data Flow
- Getting Started
- Environment Variables
- Project Structure
- API Reference
- Web3 Payment Flow
- AI Matching Engine
- Database Schema
- Deployment
| Color | Hex | Usage |
|---|---|---|
| Ruby Red | #E31C58 |
Primary accent, CTAs |
| Parrot Green | #00C853 |
Success states, wallet connected |
| Gold | #FFB800 |
Highlights, premium features |
- JWT-based Authentication - Secure token-based auth with bcrypt password hashing
- User Profiles - Complete profile management with skills, bio, and avatar
- Role-based Access - Support for both job seekers and recruiters
- Job Listings - Create, browse, filter, and apply to jobs
- Smart Filtering - Filter by skills, location, job type (remote/hybrid/onsite)
- Application Tracking - Track your job applications and their status
- Skill Extraction - OpenAI GPT-3.5 powered skill extraction from resumes/bios
- Keyword Fallback - Reliable fallback with 50+ common tech skills
- Job Matching Scores - NLP-based 0-100% compatibility scoring
- Smart Recommendations - AI-driven job suggestions based on your profile
- Activity Feed - Share updates, achievements, and thoughts
- Likes & Comments - Engage with your professional network
- Real-time Updates - Stay connected with the community
- MetaMask Wallet - Seamless wallet connection
- Polygon Mumbai Testnet - Fast, low-cost blockchain transactions
- Platform Fee - Micro-payment of 0.00001 MATIC per job post
- On-chain Verification - Transparent transaction verification
The application follows a modern full-stack Next.js architecture with clear separation between client, server, and blockchain layers.
graph TB
subgraph Client["🖥️ Client Layer"]
UI[Next.js 14 Frontend]
AuthCtx[Auth Context]
Web3Ctx[Web3 Context]
end
subgraph Server["⚙️ Server Layer"]
API[Next.js API Routes]
Auth[JWT Auth Middleware]
AI[OpenAI Integration]
end
subgraph Data["💾 Data Layer"]
MongoDB[(MongoDB Atlas)]
Models[Mongoose Models]
end
subgraph Blockchain["⛓️ Blockchain Layer"]
MetaMask[MetaMask Wallet]
Polygon[Polygon Mumbai]
Contract[Smart Contracts]
end
UI --> AuthCtx
UI --> Web3Ctx
AuthCtx --> API
Web3Ctx --> MetaMask
API --> Auth
API --> AI
Auth --> Models
Models --> MongoDB
MetaMask --> Polygon
Polygon --> Contract
| Layer | Purpose | Technologies |
|---|---|---|
| Client | User interface, state management | Next.js 14, React Context, Tailwind CSS |
| Server | API logic, authentication, AI processing | Next.js API Routes, JWT, OpenAI SDK |
| Data | Persistence, data modeling | MongoDB Atlas, Mongoose ODM |
| Blockchain | Payments, verification | Ethers.js, Polygon Mumbai, MetaMask |
mindmap
root((Employly))
Frontend
Next.js 14
TypeScript
Tailwind CSS
React Context
Backend
Next.js API Routes
JWT Authentication
Rate Limiting
Database
MongoDB Atlas
Mongoose ODM
AI/ML
OpenAI GPT-3.5
NLP Skill Matching
Keyword Extraction
Blockchain
Polygon Mumbai
Ethers.js
MetaMask
| Category | Technology | Version |
|---|---|---|
| Framework | Next.js | 14.x |
| Language | TypeScript | 5.x |
| Styling | Tailwind CSS | 3.x |
| Database | MongoDB | 6.x |
| ODM | Mongoose | 8.x |
| Authentication | JWT + bcrypt | - |
| AI | OpenAI GPT-3.5 | turbo |
| Blockchain | Polygon Mumbai | Testnet |
| Web3 | Ethers.js | 5.x |
sequenceDiagram
participant U as User
participant F as Frontend
participant A as API
participant DB as MongoDB
U->>F: Enter registration details
F->>F: Validate form inputs
F->>A: POST /api/auth/register
A->>A: Hash password (bcrypt)
A->>DB: Create user document
DB-->>A: User created
A->>A: Generate JWT token
A-->>F: Return token + user
F->>F: Store token, update context
F-->>U: Redirect to dashboard
sequenceDiagram
participant U as User
participant F as Frontend
participant MM as MetaMask
participant P as Polygon
participant A as API
participant DB as MongoDB
U->>F: Fill job form
F->>F: Validate job details
F->>MM: Request wallet connection
MM-->>F: Wallet connected
F->>MM: Check network (Mumbai)
alt Wrong network
MM->>MM: Switch to Polygon Mumbai
end
F->>MM: Send 0.00001 MATIC
MM->>P: Process transaction
P-->>MM: Transaction confirmed
MM-->>F: Return txHash
F->>A: POST /api/jobs (with txHash)
A->>P: Verify transaction
P-->>A: Transaction valid
A->>DB: Create job with verified txHash
DB-->>A: Job created
A-->>F: Return job details
F-->>U: Success! Job posted
flowchart LR
subgraph Input
UP[User Profile]
JL[Job Listing]
end
subgraph AI["🤖 AI Processing"]
SE[Skill Extraction]
NLP[NLP Analysis]
MS[Match Scoring]
end
subgraph Output
Score[Match Score 0-100%]
Matched[Matched Skills]
Missing[Missing Skills]
Rec[Recommendations]
end
UP --> SE
JL --> SE
SE --> NLP
NLP --> MS
MS --> Score
MS --> Matched
MS --> Missing
MS --> Rec
- Node.js >= 18.x
- npm >= 9.x or yarn >= 1.22
- MongoDB Atlas account (or local MongoDB)
- MetaMask browser extension
- OpenAI API key (optional, for AI features)
# Clone the repository
git clone https://github.com/your-username/employly.git
cd employly/job-portal
# Install dependencies
npm install
# Create environment file
cp .env.example .env.local
# Configure your credentials in .env.local (see section below)
# Run development server
npm run devOpen http://localhost:3000 to view the application.
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
Create a .env.local file in the root directory with the following variables:
# Database (replace with your actual MongoDB connection string)
MONGODB_URI=mongodb+srv://<your-username>:<your-password>@<your-cluster>.mongodb.net/employly
# Authentication
JWT_SECRET=your-super-secret-jwt-key-min-32-characters
# AI (Optional - falls back to keyword matching)
OPENAI_API_KEY=sk-your-openai-api-key
# Web3 Configuration
NEXT_PUBLIC_ADMIN_WALLET=0xYourAdminWalletAddress
NEXT_PUBLIC_POLYGON_RPC=https://rpc-mumbai.maticvigil.com
NEXT_PUBLIC_CHAIN_ID=80001| Variable | Required | Description |
|---|---|---|
MONGODB_URI |
✅ | MongoDB connection string |
JWT_SECRET |
✅ | Secret key for JWT token signing (min 32 chars) |
OPENAI_API_KEY |
❌ | OpenAI API key for AI features |
NEXT_PUBLIC_ADMIN_WALLET |
✅ | Wallet address to receive platform fees |
NEXT_PUBLIC_POLYGON_RPC |
✅ | Polygon Mumbai RPC URL |
NEXT_PUBLIC_CHAIN_ID |
✅ | Chain ID (80001 for Mumbai) |
src/
├── app/ # Next.js 14 App Router
│ ├── api/ # API Routes
│ │ ├── auth/ # Authentication endpoints
│ │ │ ├── register/ # POST - User registration
│ │ │ ├── login/ # POST - User login
│ │ │ └── me/ # GET - Current user
│ │ ├── jobs/ # Job management endpoints
│ │ │ ├── route.ts # GET/POST - List/Create
│ │ │ ├── [id]/ # Job by ID operations
│ │ │ ├── extract-skills/# AI skill extraction
│ │ │ └── generate-description/# AI job descriptions
│ │ ├── feed/ # Social feed endpoints
│ │ ├── profile/ # User profile endpoints
│ │ └── health/ # Health check endpoint
│ ├── auth/ # Auth pages (login, register)
│ ├── jobs/ # Job listing pages
│ ├── feed/ # Social feed page
│ └── profile/ # User profile page
├── components/ # React components
│ ├── ui/ # UI components (Navbar, etc.)
│ ├── jobs/ # Job-related components
│ ├── ai/ # AI feature components
│ └── web3/ # Web3 components (WalletConnect)
├── context/ # React Context providers
│ ├── AuthContext.tsx # Authentication state
│ └── Web3Context.tsx # Web3/Wallet state
├── lib/ # Utility libraries
│ ├── ai.ts # OpenAI integration
│ ├── auth.ts # JWT utilities
│ ├── mongodb.ts # Database connection
│ ├── web3.ts # Blockchain utilities
│ ├── rateLimit.ts # API rate limiting
│ └── validations.ts # Input validation
├── models/ # Mongoose schemas
│ ├── User.ts # User model
│ ├── Job.ts # Job listing model
│ ├── Post.ts # Social post model
│ └── ScrapedJob.ts # Scraped jobs model
├── hooks/ # Custom React hooks
└── types/ # TypeScript definitions
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/auth/register |
Register new user | ❌ |
POST |
/api/auth/login |
Login user | ❌ |
GET |
/api/auth/me |
Get current user | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/api/jobs |
List all jobs | ❌ |
POST |
/api/jobs |
Create job (requires payment) | ✅ |
GET |
/api/jobs/[id] |
Get job details | ❌ |
POST |
/api/jobs/[id]/apply |
Apply to job | ✅ |
POST |
/api/jobs/extract-skills |
AI skill extraction | ✅ |
POST |
/api/jobs/generate-description |
AI job description | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/api/feed |
List all posts | ❌ |
POST |
/api/feed |
Create new post | ✅ |
POST |
/api/feed/[id]/like |
Like a post | ✅ |
POST |
/api/feed/[id]/comment |
Comment on post | ✅ |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/api/profile |
Get user profile | ✅ |
PUT |
/api/profile |
Update profile | ✅ |
stateDiagram-v2
[*] --> FillForm: User fills job form
FillForm --> ConnectWallet: Click "Continue to Payment"
ConnectWallet --> CheckNetwork: Wallet connected
CheckNetwork --> SwitchNetwork: Wrong network
SwitchNetwork --> CheckNetwork: Network switched
CheckNetwork --> InitPayment: Correct network
InitPayment --> ConfirmTx: Confirm in MetaMask
ConfirmTx --> WaitConfirm: Transaction submitted
WaitConfirm --> VerifyTx: Transaction mined
VerifyTx --> CreateJob: Verification passed
CreateJob --> [*]: Job posted successfully
ConfirmTx --> [*]: User rejected
VerifyTx --> [*]: Verification failed
| Property | Value |
|---|---|
| Network | Polygon Mumbai Testnet |
| Chain ID | 80001 |
| Currency | MATIC |
| Platform Fee | 0.00001 MATIC |
| Recipient | Admin Wallet (configured) |
To post jobs, you'll need testnet MATIC tokens:
- Visit the Polygon Faucet
- Enter your wallet address
- Select "Mumbai" network
- Request test MATIC
The AI matching system uses a hybrid approach combining OpenAI's GPT-3.5 with keyword-based fallback.
flowchart TD
Input[User Bio/Resume Text]
Check{OpenAI Available?}
Input --> Check
Check -->|Yes| GPT[GPT-3.5 Extraction]
Check -->|No| Keyword[Keyword Matching]
GPT --> Parse[Parse JSON Response]
Parse --> Validate[Validate Skills]
Keyword --> Pattern[Pattern Matching]
Pattern --> CommonSkills[Match 50+ Tech Skills]
Validate --> Output[Extracted Skills Array]
CommonSkills --> Output
The matching algorithm considers:
- Skill Overlap - Direct matches between user skills and job requirements
- Semantic Similarity - AI-powered understanding of related skills
- Experience Level - Inferred from bio and skill count
- Missing Skills - Gap analysis for improvement suggestions
| Score Range | Interpretation | Color |
|---|---|---|
| 80-100% | Excellent match | 🟢 Green |
| 60-79% | Good match | 🟡 Yellow |
| 40-59% | Moderate match | 🟠 Orange |
| 0-39% | Low match | 🔴 Red |
erDiagram
USER ||--o{ JOB : posts
USER ||--o{ POST : creates
USER }o--o{ JOB : applies
POST ||--o{ COMMENT : has
POST ||--o{ LIKE : receives
USER {
ObjectId _id PK
string email UK
string password
string name
string bio
string linkedinUrl
string avatarUrl
array skills
string walletAddress
boolean isRecruiter
datetime createdAt
datetime updatedAt
}
JOB {
ObjectId _id PK
string title
string description
array requiredSkills
object budget
string location
enum locationType
array tags
ObjectId poster FK
string paymentTxHash
enum status
array applicants FK
number views
datetime createdAt
datetime updatedAt
}
POST {
ObjectId _id PK
ObjectId author FK
string content
string imageUrl
array likes FK
array comments
datetime createdAt
datetime updatedAt
}
- Indexed on
skillsfor fast job matching queries - Unique constraint on
email - Password hashed with bcrypt before storage
- Text index on
titleanddescriptionfor search - Indexed on
requiredSkills,tags,location,status,createdAt - References
Userfor poster and applicants
# Install Vercel CLI
npm i -g vercel
# Build and deploy
vercel --prod- Create a new Vercel project
- Add all environment variables in Vercel dashboard
- Connect your MongoDB Atlas cluster (whitelist Vercel IPs)
- Deploy!
# Production build
npm run build
# Check for errors
npm run lint
# Start production server locally
npm start- Password Hashing - bcrypt with salt rounds
- JWT Authentication - Secure token-based auth
- Input Validation - Zod schema validation
- Rate Limiting - Prevent API abuse
- XSS Protection - Input sanitization
- CORS - Configured for allowed origins
- 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 - see the LICENSE file for details.
Built with ❤️ by the Employly Team