ScholarHub is a Next.js dashboard for Indonesian students to discover scholarships, monitor deadlines, browse related universities, and track personal application progress. The app is currently built as an MVP with a single default user and a service-layer architecture that keeps database logic separate from pages and API routes.
- Node.js 18+; the project has been run with Node 18.20.8.
- npm.
- A PostgreSQL database URL in
DATABASE_URL.
npm installThe Prisma schema uses PostgreSQL. The old prisma/dev.db SQLite file is a legacy artifact and is not the active datasource.
npx prisma generate
npx prisma migrate dev
npx prisma db seednpm run devOpen http://localhost:3000.
- Framework: Next.js 14 App Router with React 18 and TypeScript.
- Styling: Tailwind CSS 3 with a light slate/indigo dashboard visual system.
- Database: PostgreSQL through Prisma ORM 6.
- Icons:
lucide-react. - Utilities:
clsx,tailwind-merge, anddate-fns. - Package manager: npm with
package-lock.json.
ScholarHub follows a service-layer pattern inside the Next.js App Router:
- Routes and pages in
src/apprender UI and expose API endpoints. - Services in
src/serviceshold reusable business/data-access workflows. - Prisma in
src/lib/db.tsis exposed through a singleton client to avoid duplicate clients during local hot reload. - Shared constants and formatting helpers live in
src/lib/utils.ts. - Database models and seed data live in
prisma/.
Most read-heavy pages use server components where possible, while interactive catalog, tracker, admin, and tracking controls use client components that call the API routes.
.
├── prisma/
│ ├── schema.prisma # PostgreSQL Prisma models
│ ├── seed.ts # Seed data for scholarships, universities, links, users
│ └── migrations/ # Prisma migration history
├── src/
│ ├── app/
│ │ ├── api/ # JSON API routes for scholarships, universities, applications
│ │ ├── admin/ # Scholarship management page
│ │ ├── scholarships/ # Catalog, detail page, track button
│ │ ├── tracker/ # Application progress tracker
│ │ ├── universities/ # University list and detail pages
│ │ ├── layout.tsx # Root layout and navbar shell
│ │ ├── page.tsx # Dashboard overview
│ │ └── globals.css # Tailwind directives and base colors
│ ├── components/
│ │ └── Navbar.tsx # Top navigation
│ ├── lib/
│ │ ├── db.ts # Prisma singleton
│ │ └── utils.ts # Class merging, dates, labels, status constants
│ └── services/
│ ├── applications.ts # Tracking, status, checklist, application stats
│ ├── scholarships.ts # Catalog filters, CRUD, stats, deadlines
│ ├── universities.ts # University CRUD and scholarship joins
│ └── integrations/ # Future scraper/API integration types
├── design.md # Current UI style guide
├── DEPLOYMENT.md # Deployment notes
└── .agents/rules/ # Universal AI-agent rules for this project
- Dashboard overview: Counts open, upcoming, and closed scholarships; shows upcoming deadlines, tracked applications, and recently added scholarships.
- Scholarship catalog: Client-side filter UI backed by
/api/scholarshipsfor status, provider type, degree level, funding type, search, and sort. - Scholarship details: Server-rendered detail pages with timeline, resources, related universities, key info, and a track-status control.
- Application tracker: Single-user MVP tracker for statuses, checklists, progress percentages, notes, deadlines, and deletion.
- University browser: Searchable university list and university detail pages linked to scholarship records.
- Admin scholarship management: Client-side page for creating and deleting scholarships through API routes.
- REST-like API routes: Scholarship, university, and application CRUD endpoints plus query-param actions for stats/deadlines.
The core Prisma models are:
Scholarship: Main scholarship entity with slug, provider/funding/degree/status fields, dates, links, related universities, and default checklist JSON stored as text.ScholarshipDate: Timeline milestones for a scholarship.ScholarshipLink: Resource links such as official pages, guides, forums, videos, documents, and social media.UniversityandUniversityLink: University records and external links.ScholarshipUniversity: Join table between scholarships and universities.UserProfile: MVP user profile data.UserApplication: A user scholarship tracking record with status, notes, applied timestamp, and checklist JSON stored as text.
The current UI follows the style documented in design.md:
- Light mode with
slate-50page backgrounds, white cards,slate-200borders, andslate-900text. - Indigo is the primary accent for brand, icons, focus rings, and primary actions.
- Semantic badge colors: emerald for open/accepted, blue for upcoming/applied, amber for warning/preparing, red for closed/rejected, slate for neutral states.
- Layouts use
max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8. - Cards usually use
bg-white rounded-xl border border-slate-200 p-5 shadow-sm. - Icons come from
lucide-react; header icons are generallyw-7 h-7 text-indigo-500.
design.md: Source of truth for UI style, spacing, component conventions, badges, buttons, and icon usage.DEPLOYMENT.md: Deployment-oriented setup notes.tailwind.config.js: Tailwind content configuration forsrc/**/*.eslint.config.mjs: ESLint setup.next.config.mjs: Next.js configuration.postcss.config.js: Tailwind/PostCSS integration..agents/rules/scholarhub-project.md: Project-specific AI-agent coding rules..agents/rules/pr-generator-rule.mdc: PR-summary helper rule for staged or full git diffs..agents/rules/write-changelog.mdc: Changelog writer rule for release notes from git diffs.
DEFAULT_USER_IDis currently hardcoded asdefault-userin application routes and server pages. Do not assume multi-user auth exists yet.- Checklist fields are stored as JSON strings in Prisma text columns. API routes stringify checklist arrays before persistence.
- Date values such as
openDate,closeDate, andScholarshipDate.dateValueare stored as strings inYYYY-MM-DDstyle and formatted in the UI. src/lib/utils.tsis the canonical place for status arrays, labels, badge mappings, date helpers, and slug generation.- Use the service layer for Prisma access rather than querying Prisma directly from client components.
- Add authentication and replace the hardcoded default user.
- Add Google Calendar or notification integration for deadlines.
- Add scraper/API integrations for scholarship providers.
- Expand admin editing beyond create/delete.
- Add validation and stronger typed request payloads for API routes.