A production-ready MERN stack application that enables companies/NGOs to post micro-tasks, students to submit real work, and AI-powered skill verification using Azure OpenAI.
- Multi-Role Authentication: Students, Providers (Companies/NGOs), and Recruiters
- Task Marketplace: Browse and submit to real-world micro-tasks
- AI Skill Verification: Azure OpenAI evaluates submissions and generates verified skill scores
- Student Dashboard: Track skills, view charts, and see verified badges
- Recruiter Tools: Search students by verified skills and download reports
- GitHub Integration: Automatic repository metadata fetching
- Structured AI Evaluation: Deterministic JSON responses with skill breakdowns
- Node.js + Express.js
- MongoDB with Mongoose
- JWT authentication
- Azure OpenAI (GPT-4/GPT-4o)
- bcryptjs for password hashing
- React 18 with Vite
- Tailwind CSS for styling
- Recharts for data visualization
- React Router for navigation
- Axios for API calls
- Node.js (v18 or higher)
- MongoDB (local or Atlas)
- Azure OpenAI account with API key and endpoint
- (Optional) GitHub Personal Access Token for enhanced repo metadata
git clone <repository-url>
cd SkillGaurd-AIcd backend
npm installCreate a .env file in the backend directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# MongoDB
MONGODB_URI=mongodb://localhost:27017/workmark
# Or use MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/workmark
# Google OAuth (for Google Sign-In)
GOOGLE_CLIENT_ID=your-google-client-id
# JWT
JWT_SECRET=your-super-secret-jwt-key-change-in-production
JWT_EXPIRE=7d
# Azure OpenAI Configuration
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_API_KEY=your-azure-openai-api-key
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4
AZURE_OPENAI_API_VERSION=2024-02-15-preview
# GitHub API (optional, for enhanced repo metadata)
GITHUB_TOKEN=your-github-token-optionalGetting Azure OpenAI Credentials:
- Create an Azure account and set up an Azure OpenAI resource
- Deploy a model (GPT-4 or GPT-4o) in your Azure OpenAI resource
- Get your endpoint URL (format:
https://your-resource.openai.azure.com/) - Get your API key from the Azure portal
- Note your deployment name
Getting GitHub Token (Optional):
- Go to GitHub Settings β Developer settings β Personal access tokens
- Generate a new token with
public_reposcope - Add it to your
.envfile
cd ../frontend
npm installCreate a .env file in the frontend directory (optional):
VITE_API_URL=http://localhost:5000/api
VITE_GOOGLE_CLIENT_ID=your-google-client-idMake sure MongoDB is running:
# If using local MongoDB
mongod
# Or use MongoDB Atlas (cloud) - no local setup neededTerminal 1 - Backend:
cd backend
npm run devThe backend server will start on http://localhost:5000
Terminal 2 - Frontend:
cd frontend
npm run devThe frontend will start on http://localhost:3000
To create demo accounts for testing:
cd backend
npm run seed:demoThis will create three demo accounts:
- Student:
student@demo.com/demo123 - Provider:
provider@demo.com/demo123 - Recruiter:
recruiter@demo.com/demo123
These credentials are also displayed on the login page for easy access.
WorkMark/
βββ backend/
β βββ config/
β β βββ database.js # MongoDB connection
β βββ controllers/
β β βββ authController.js # Authentication logic
β β βββ taskController.js # Task CRUD operations
β β βββ submissionController.js # Submission handling & AI evaluation
β β βββ recruiterController.js # Recruiter search & reports
β βββ middleware/
β β βββ auth.js # JWT authentication & authorization
β β βββ errorHandler.js # Error handling middleware
β βββ models/
β β βββ User.js # User schema (Student/Provider/Recruiter)
β β βββ Task.js # Task schema
β β βββ Submission.js # Submission schema
β β βββ SkillVerification.js # AI evaluation results schema
β βββ routes/
β β βββ authRoutes.js # Auth endpoints
β β βββ taskRoutes.js # Task endpoints
β β βββ submissionRoutes.js # Submission endpoints
β β βββ recruiterRoutes.js # Recruiter endpoints
β βββ services/
β β βββ azureOpenAI.js # Azure OpenAI integration (CORE AI LOGIC)
β β βββ githubService.js # GitHub API integration
β βββ server.js # Express server entry point
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Navbar.jsx # Navigation component
β β β βββ PrivateRoute.jsx # Protected route wrapper
β β βββ context/
β β β βββ AuthContext.jsx # Authentication context
β β βββ pages/
β β β βββ Login.jsx
β β β βββ Register.jsx
β β β βββ StudentDashboard.jsx # Skill charts & stats
β β β βββ TaskMarketplace.jsx
β β β βββ TaskDetail.jsx
β β β βββ SubmissionForm.jsx
β β β βββ ProviderDashboard.jsx
β β β βββ RecruiterDashboard.jsx
β β β βββ RecruiterSearch.jsx
β β β βββ StudentProfile.jsx
β β βββ services/
β β β βββ api.js # API service layer
β β βββ App.jsx # Main app component
β β βββ main.jsx # React entry point
β βββ package.json
β
βββ README.md
The core AI evaluation happens in backend/services/azureOpenAI.js. When a student submits:
- Submission Processing: The system extracts submission metadata (GitHub repo info or file details)
- Prompt Construction: A structured prompt is built with:
- Task details (title, description, required skills, difficulty)
- Evaluation criteria
- Submission content/metadata
- Azure OpenAI Call: The prompt is sent to Azure OpenAI with:
temperature: 0.3for deterministic resultsresponse_format: { type: 'json_object' }to force JSON output
- Response Validation: The AI response is parsed and validated against the required schema
- Database Storage: Results are saved to
SkillVerificationcollection with full audit trail
AI Response Format:
{
"overallScore": 85,
"skillBreakdown": {
"JavaScript": 90,
"React": 85,
"Node.js": 80
},
"strengths": ["Clean code structure", "Good error handling"],
"weaknesses": ["Missing tests", "Could improve documentation"],
"resumeBullet": "Developed a full-stack web application using React and Node.js, demonstrating proficiency in modern JavaScript frameworks and RESTful API design.",
"plagiarismRisk": "low"
}- User registers with email, password, and role
- Password is hashed using bcryptjs
- JWT token is generated and returned
- Token is stored in localStorage (frontend)
- All protected routes require valid JWT token
- Role-based access control enforced via middleware
- Student submits: GitHub URL or file upload
- GitHub processing (if applicable):
- URL parsed to extract owner/repo/branch
- GitHub API fetches metadata (language, stars, README, etc.)
- Submission saved with status:
pending - Async evaluation triggered:
- Status changes to
evaluating - Azure OpenAI service called
- Results saved to
SkillVerification - Status changes to
evaluated - User's
verifiedSkillsarray updated
- Status changes to
Create accounts for each role:
- Student: Register with role "student"
- Provider: Register with role "provider"
- Recruiter: Register with role "recruiter"
- Login as a provider
- Navigate to Provider Dashboard
- Create a new task with:
- Title, description
- Required skills (e.g., "JavaScript", "React")
- Difficulty level
- Deadline
- Instructions and evaluation criteria
- Login as a student
- Browse tasks in the marketplace
- Click on a task to view details
- Click "Submit Solution"
- Choose GitHub URL or file upload
- Submit and wait for AI evaluation
- Student: Check dashboard for skill scores and charts
- Recruiter: Search students and view detailed profiles
- Password hashing with bcryptjs
- JWT token-based authentication
- Role-based access control (RBAC)
- Input validation with express-validator
- Protected API routes
- CORS configuration
- Basic info (name, email, password)
- Role (student/provider/recruiter)
- Profile (bio, skills, institution, etc.)
- Verified skills array (populated by AI evaluations)
- Title, description, instructions
- Provider reference
- Required skills array
- Difficulty, deadline, status
- Submission limits
- Task and student references
- Submission type (github/file)
- GitHub metadata or file info
- Status (pending/evaluating/evaluated/failed)
- Evaluation result reference
- Submission reference
- Overall score and skill breakdown
- Strengths, weaknesses
- Resume bullet point
- Plagiarism risk assessment
- Full AI prompt and response (audit trail)
MongoDB Connection Error:
- Ensure MongoDB is running
- Check
MONGODB_URIin.env - Verify network connectivity for Atlas
Azure OpenAI Errors:
- Verify endpoint URL format (must end with
/) - Check API key is correct
- Ensure deployment name matches your Azure resource
- Verify API version is supported
JWT Errors:
- Check
JWT_SECRETis set - Ensure token is sent in Authorization header:
Bearer <token>
API Connection Errors:
- Verify backend is running on port 5000
- Check
VITE_API_URLin frontend.env - Check browser console for CORS errors
Authentication Issues:
- Clear localStorage and re-login
- Check token expiration (default: 7 days)
| Variable | Description | Required |
|---|---|---|
PORT |
Server port | No (default: 5000) |
NODE_ENV |
Environment mode | No |
MONGODB_URI |
MongoDB connection string | Yes |
JWT_SECRET |
Secret for JWT signing | Yes |
JWT_EXPIRE |
Token expiration | No (default: 7d) |
AZURE_OPENAI_ENDPOINT |
Azure OpenAI endpoint URL | Yes |
AZURE_OPENAI_API_KEY |
Azure OpenAI API key | Yes |
AZURE_OPENAI_DEPLOYMENT_NAME |
Model deployment name | Yes |
AZURE_OPENAI_API_VERSION |
API version | No (default: 2024-02-15-preview) |
GITHUB_TOKEN |
GitHub personal access token | No |
| Variable | Description | Required |
|---|---|---|
VITE_API_URL |
Backend API URL | No (default: /api) |