Skip to content

Latest commit

Β 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ NUCAP - National University Admission Platform

NUCAP Logo

Empowering 1M+ Pakistani Students to Never Miss a University Deadline

GitHub License Next.js TypeScript PostgreSQL

πŸš€ Live Demo | πŸ“– Documentation | πŸ› Report Bug | ✨ Request Feature


πŸ“‹ Table of Contents


🎯 Overview

NUCAP (National University Admission Platform) is a comprehensive web application designed to solve the critical problem of students missing university admission deadlines in Pakistan. Every year, thousands of talented students lose opportunities because admission information is scattered across multiple university websites, frequently changes, and is difficult to track.

Key Statistics

  • πŸŽ“ Target Users: 1M+ Intermediate (12th grade) students
  • 🏫 Universities Covered: NUST, FAST, COMSATS, Punjab University (expandable)
  • ⏰ Automated Tracking: Real-time deadline monitoring and alerts
  • πŸ“Š Smart Matching: AI-powered university recommendations based on academic profile

πŸ’‘ Problem Statement

The Challenge

Pakistani students face several challenges during university admissions:

  1. Scattered Information πŸ“š

    • Each university has its own website with different layouts
    • Admission criteria changes frequently
    • Merit lists published at different times
  2. Missed Deadlines ⏰

    • No centralized platform for deadline tracking
    • Manual checking of multiple websites is time-consuming
    • Last-minute announcements go unnoticed
  3. Uncertainty ❓

    • Students don't know their admission chances
    • Comparing merit across universities is difficult
    • No guidance on which universities to apply to

Our Solution

NUCAP solves these problems by:

βœ… Centralizing all university information in one place
βœ… Automating deadline tracking and notifications
βœ… Calculating merit and matching students with universities
βœ… Providing real-time updates and announcements
βœ… Simplifying the entire admission process


✨ Features

For Students

🎯 Academic Profile Management

  • Create comprehensive academic profile
  • Store Matric and Inter marks
  • Add test scores (NUST, FAST, NTS)
  • Set preferences (cities, fields, budget)

πŸ“Š Merit Calculator

  • Calculate merit for multiple universities instantly
  • University-specific formulas (NUST, FAST, COMSATS, Punjab)
  • Real-time percentage calculation
  • Estimated vs. required merit comparison

πŸŽ“ Smart University Matching

  • AI-powered recommendations based on profile
  • Match score algorithm (0-100)
  • Admission chances (High/Good/Medium/Low)
  • Merit gap analysis
  • Department-wise breakdown

⏰ Deadline Tracking

  • Upcoming deadlines dashboard
  • Countdown timers
  • Multi-university tracking
  • Important date reminders

πŸ“° Real-Time Updates

  • Latest announcements from universities
  • Merit list publications
  • Deadline extensions
  • Important notices

πŸ” University Explorer

  • Browse all universities
  • Filter by city, test type, field
  • Department details
  • Historical merit data
  • Direct application links

For Administrators

πŸ› οΈ Admin Dashboard

  • System statistics overview
  • User analytics
  • Scraping activity monitoring
  • Manual data entry forms

πŸ€– Web Scraping Management

  • Automated data collection from university websites
  • Custom scrapers for each university
  • Scraping logs and error tracking
  • Manual trigger for on-demand updates

πŸ“ Content Management

  • Add/edit university information
  • Update admission timelines
  • Publish announcements
  • Manage merit lists

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 15.5 (App Router)
  • Language: TypeScript 5.0
  • Styling: Tailwind CSS 4.0
  • UI Components: Shadcn/ui
  • Icons: Lucide React
  • Forms: React Hook Form + Zod validation

Backend

  • Runtime: Node.js 22
  • API: Next.js API Routes
  • Authentication: Clerk
  • Database: PostgreSQL 16
  • ORM: Prisma 6.17

Infrastructure

  • Hosting: Vercel
  • Database Hosting: Vercel Postgres / Supabase / Neon
  • Cron Jobs: Vercel Cron
  • Web Scraping: Jina AI API + Cheerio

Development Tools

  • Package Manager: npm
  • Linting: ESLint
  • Type Checking: TypeScript
  • Database GUI: Prisma Studio

πŸ—οΈ Architecture

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CLIENT (Browser)                         β”‚
β”‚                     Next.js 15 Frontend                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚  Landing β”‚  β”‚Dashboard β”‚  β”‚Universitiesβ”‚ β”‚ Profile  β”‚       β”‚
β”‚  β”‚   Page   β”‚  β”‚          β”‚  β”‚  Explorer  β”‚ β”‚ Creation β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ HTTP/HTTPS
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    API LAYER (Next.js)                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Student API  β”‚  β”‚Universities APIβ”‚  β”‚   Admin API    β”‚   β”‚
β”‚  β”‚  - Profile     β”‚  β”‚  - List        β”‚  β”‚  - Manage Data β”‚   β”‚
β”‚  β”‚  - Merit Calc  β”‚  β”‚  - Details     β”‚  β”‚  - Scraping    β”‚   β”‚
β”‚  β”‚  - Matches     β”‚  β”‚  - Filter      β”‚  β”‚  - Analytics   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                  β”‚                  β”‚
         β–Ό                  β–Ό                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Authentication β”‚  β”‚    Database    β”‚  β”‚  Web Scraping  β”‚
β”‚     (Clerk)    β”‚  β”‚  (PostgreSQL)  β”‚  β”‚   (Jina AI)    β”‚
β”‚                β”‚  β”‚                β”‚  β”‚                β”‚
β”‚ - User Mgmt    β”‚  β”‚ - Users        β”‚  β”‚ - NUST         β”‚
β”‚ - Sessions     β”‚  β”‚ - Universities β”‚  β”‚ - FAST         β”‚
β”‚ - Protected    β”‚  β”‚ - Departments  β”‚  β”‚ - COMSATS      β”‚
β”‚   Routes       β”‚  β”‚ - Merit Lists  β”‚  β”‚ - Punjab       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow

Student Creates Profile
         β”‚
         β”œβ”€> Save to Database (PostgreSQL)
         β”‚
         β”œβ”€> Calculate Merit (All Universities)
         β”‚
         β”œβ”€> Generate Matches (Algorithm)
         β”‚
         └─> Display Results (Dashboard)

Automated Scraping (Every 12 hours)
         β”‚
         β”œβ”€> Jina AI fetches university websites
         β”‚
         β”œβ”€> Custom scrapers extract data
         β”‚
         β”œβ”€> Parse deadlines, merit lists, announcements
         β”‚
         β”œβ”€> Save to database
         β”‚
         └─> Students see updated information

Merit Calculation Algorithm

For each university:
  Student Merit = (Matric% Γ— W1) + (Inter% Γ— W2) + (Test Score Γ— W3)
  
  Where weights differ by university:
  
  NUST:    W1=10%, W2=15%, W3=75% (Test out of 200)
  FAST:    W1=10%, W2=40%, W3=50% (Test out of 100)
  COMSATS: W1=15%, W2=35%, W3=50% (Test out of 100)
  Punjab:  W1=20%, W2=50%, W3=30% (Test out of 100)

Matching Algorithm

Match Score (0-100) = Merit Compatibility (50%) 
                    + Location Preference (25%) 
                    + Field Preference (25%)

Admission Chance:
  - Merit Gap β‰₯ 5%:  HIGH
  - Merit Gap β‰₯ 0%:  GOOD
  - Merit Gap β‰₯ -3%: MEDIUM
  - Merit Gap < -3%: LOW

πŸš€ Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

Admin Panel

The application includes an admin panel for managing university data, merit lists, and admission timelines.

Admin Setup

  1. Create a .env file based on .env.example
  2. Set your admin credentials:
    ADMIN_USERNAME=your_admin_username
    ADMIN_PASSWORD=your_admin_password
    

Accessing the Admin Panel

  1. Navigate to http://localhost:3000/admin
  2. You'll be redirected to the login page if not authenticated
  3. Enter your admin credentials to access the panel

Admin Features

  • University Management: Add, edit, and manage universities and their departments
  • Merit Lists: Create and update merit lists for university departments
  • Admission Timelines: Set important dates for admission processes
  • System Monitoring: View system statistics and scraping logs

Quick Start Commands

# Development
npm run dev              # Start dev server
npm run build            # Build for production
npm run start            # Start production server

# Database
npm run db:generate      # Generate Prisma Client
npm run db:migrate       # Run migrations
npm run db:seed          # Seed database
npm run db:studio        # Open Prisma Studio

# Testing
npm run lint             # Run ESLint
npx tsx scripts/test-scraper.ts NUST  # Test scraper

πŸ“– For detailed setup instructions, see SETUP.md
πŸš€ For quick deployment, see QUICKSTART.md


πŸ“š API Documentation

Student Endpoints

Create Profile

POST /api/student/profile
Content-Type: application/json

{
  "matricTotalMarks": 1100,
  "matricObtainedMarks": 950,
  "matricBoard": "Federal",
  "matricYear": 2022,
  "interTotalMarks": 1100,
  "interObtainedMarks": 900,
  "interBoard": "Federal",
  "interGroup": "Pre-Eng",
  "interYear": 2024,
  "nustTestScore": 140,
  "fastTestScore": 75,
  "preferredCities": ["Islamabad", "Lahore"],
  "preferredFields": ["Computer Science", "Engineering"]
}

Calculate Merit

POST /api/student/calculate-merit
Content-Type: application/json

{
  "matricPercentage": 86.4,
  "interPercentage": 81.8,
  "testScores": {
    "NUST": 140,
    "FAST": 75
  }
}

Generate Matches

POST /api/student/generate-matches

University Endpoints

List Universities

GET /api/universities
GET /api/universities?city=Islamabad
GET /api/universities?testType=NUST
GET /api/universities?category=Engineering

Get University Details

GET /api/universities/{id}

Admin Endpoints

Trigger Scraping

POST /api/cron/scrape-universities
Authorization: Bearer {CRON_SECRET}

Add Deadline

POST /api/admin/add-deadline
Content-Type: application/json

{
  "universityId": "...",
  "year": 2025,
  "cycle": "Fall 2025",
  "applicationDeadline": "2025-03-15",
  "testDate": "2025-04-20"
}

πŸ—„οΈ Database Schema

Core Models

  • User: Authentication and basic info
  • StudentProfile: Academic credentials and preferences
  • University: University information
  • Department: Program details
  • MeritList: Historical merit data
  • AdmissionTimeline: Deadline tracking
  • UniversityUpdate: News and announcements
  • StudentMatch: University recommendations
  • ScrapingLog: Scraping activity logs

Entity Relationship Diagram

User (1) ──────────────> (1) StudentProfile
                               β”‚
                               β”‚ (1)
                               β–Ό
                          StudentMatch (N)
                               β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                                             β”‚
        β”‚ (1)                                    (1)  β”‚
        β–Ό                                             β–Ό
   University (1) ─────────────────────> (N) Department
        β”‚                                             β”‚
        β”œβ”€β”€β”€β”€β”€β”€> (N) MeritList                       β”‚
        β”œβ”€β”€β”€β”€β”€β”€> (N) AdmissionTimeline               β”‚
        β”œβ”€β”€β”€β”€β”€β”€> (N) UniversityUpdate                β”‚
        └──────> (N) ScrapingLog                     β”‚
                                                      β”‚
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                         MeritList (N)

πŸ“– For complete schema details, see prisma/schema.prisma


🚒 Deployment

Deploy to Vercel (Recommended)

  1. Push to GitHub

    git add .
    git commit -m "Ready for deployment"
    git push origin main
  2. Connect to Vercel

    • Go to vercel.com
    • Import repository
    • Configure environment variables
    • Deploy
  3. Set up Database

    • Use Vercel Postgres, Supabase, or Neon
    • Run migrations: npx prisma migrate deploy
    • Seed data: npx prisma db seed
  4. Configure Clerk

    • Update allowed domains in Clerk dashboard
    • Set production redirect URLs

πŸ“– For detailed deployment guide, see DEPLOYMENT.md


πŸ§ͺ Testing

The application includes a comprehensive test suite to ensure reliability and correctness.

Test Structure

  • Unit Tests: Located in __tests__ directory
  • Integration Tests: API route tests
  • Authentication Tests: Admin and user authentication flows

Running Tests

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage report
npm run test:coverage

# Run specific test file
npx jest __tests__/adminAuth.test.ts

Test Coverage

  • Admin authentication system
  • Student profile API endpoints
  • University management API endpoints
  • Core application functionality

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

Ways to Contribute

Development Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test thoroughly
  5. Commit (git commit -m 'Add amazing feature')
  6. Push (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Use TypeScript for all new code
  • Follow existing code patterns
  • Add comments for complex logic
  • Write meaningful commit messages
  • Update documentation as needed

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Saad Khan Tareen


πŸ™ Acknowledgments

  • Jina AI for web scraping capabilities
  • Clerk for authentication services
  • Vercel for hosting platform
  • Shadcn/ui for beautiful UI components
  • All contributors and supporters

πŸ“ž Contact & Support


Made with ❀️ for Pakistani Students

⭐ Star us on GitHub if you find this project helpful!

⬆ Back to Top

Thank You!

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages