Interntrack is a full-stack internship management platform for colleges. It lets students submit internship details, enables teachers to review and approve them, tracks daily attendance through HR email verification, and keeps an audit trail of verification activity.
The current app is built with Next.js App Router, Prisma, PostgreSQL, JWT cookie auth, Tailwind CSS, and shadcn/ui.
- Sign up and log in as a student
- Submit an internship form with company, duration, stipend, mode, offer letter URL, HR email, and department coordinator email
- View approval status, rejection reasons, and internship history
- Request daily attendance verification for the active internship
- Track attendance through calendar and heatmap style views
- Sign up and log in as a teacher
- Review pending internship forms
- Approve or reject submissions with a required rejection reason
- View student and attendance activity from the dashboard
- Manage department coordinators by branch
- Review audit logs for attendance verification events
- Access analytics dashboards for placements, companies, stipend trends, attendance rate, and exports
- Send or receive periodic attendance report emails
- No login is required for HR
- A student requests attendance for the active internship
- Interntrack emails HR a verification link with
presentandabsentactions - The link updates attendance status and stores verification metadata such as IP address and user agent
flowchart LR
student[Student]
teacher[Teacher]
hr[HR]
system((Interntrack))
db[(Database)]
mail[Email Service]
student -->|Forms and attendance requests| system
teacher -->|Approvals, logs, analytics| system
hr -->|Attendance verification| system
system -->|Dashboard responses| student
system -->|Dashboard responses| teacher
system -->|Verification result| hr
system <--> db
system -->|Attendance and report emails| mail
mail --> hr
mail --> teacher
flowchart TB
student[Student]
teacher[Teacher]
hr[HR]
p1((1.0 Auth))
p2((2.0 Internship Form Processing))
p3((3.0 Attendance Request))
p4((4.0 HR Verification))
p5((5.0 Logs and Analytics))
d1[(D1 Users)]
d2[(D2 Internship Forms)]
d3[(D3 Attendance)]
d4[(D4 Verification Logs)]
mail[Email Service]
student -->|Sign up / log in| p1
teacher -->|Sign up / log in| p1
p1 <--> d1
student -->|Submit internship form| p2
teacher -->|Approve / reject form| p2
p2 <--> d2
p2 -->|Assigned teacher data| d1
student -->|Request attendance| p3
p3 -->|Check active internship| d2
p3 <--> d3
p3 -->|Send verification email| mail
mail -->|Verification link| hr
hr -->|Present / absent response| p4
p4 -->|Validate attendance token| d3
p4 -->|Update status| d3
p4 -->|Store audit entry| d4
teacher -->|View logs / analytics| p5
student -->|View attendance history| p5
p5 --> d2
p5 --> d3
p5 --> d4
At a glance:
- The high-level DFD shows the main users, the app, the database, and email delivery.
- The low-level DFD shows the main internal processes, data stores, and how attendance verification moves through the system.
- Next.js 13.5 App Router
- React 18
- TypeScript
- Prisma ORM
- PostgreSQL
- JWT authentication via cookies
- Nodemailer for SMTP email delivery
- Tailwind CSS + shadcn/ui
- Recharts for analytics visualizations
The main Prisma models are:
User: students and teachersInternshipForm: internship application and approval stateAttendance: one attendance request per day per internshipVerificationLog: audit log for HR verification actionsDepartmentCoordinator: branch-wise coordinator directory
Current internship statuses:
PENDINGAPPROVEDCOMPLETEDREJECTED
Current attendance statuses:
PENDINGVERIFIEDABSENT
app/
api/ API routes for auth, forms, attendance, analytics, cron jobs
student/ Student auth and dashboard pages
teacher/ Teacher auth, dashboard, and analytics pages
components/
student/ Student dashboard and form UI
teacher/ Teacher dashboard, logs, coordinator management UI
ui/ Shared shadcn/ui components
lib/
auth.ts JWT, password hashing, auth helpers
email.ts Attendance and report email helpers
prisma.ts Prisma client singleton
prisma/
schema.prisma Database schema
migrations/ Prisma migrations
middleware.ts Route protection for dashboard pages
vercel.json Vercel cron configuration
pnpm is the preferred package manager in this repo.
pnpm installIf you use npm, keep to npm consistently for install and scripts.
cp .env.example .envThen update the values for your local database, JWT secret, SMTP provider, and base URL.
pnpm prisma generate
pnpm prisma migrate devpnpm devOpen:
http://localhost:3000- Student login:
http://localhost:3000/student/login - Teacher login:
http://localhost:3000/teacher/login
| Variable | Required | Purpose |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection used by Prisma |
JWT_SECRET |
Yes | Signs and verifies auth and attendance tokens |
SMTP_HOST |
Recommended | SMTP host for attendance and report emails |
SMTP_PORT |
Recommended | SMTP port |
SMTP_USER |
Recommended | SMTP username |
SMTP_PASS |
Recommended | SMTP password |
NEXT_PUBLIC_BASE_URL |
Recommended | Base URL used in attendance verification links |
CRON_SECRET |
Required in production | Protects scheduled job endpoints |
NEXT_PUBLIC_ENABLE_REPORTS |
Optional | Toggles teacher report visibility in the dashboard |
In development, both login routes accept:
- Email:
admin - Password:
admin123
That shortcut works for:
/api/auth/login/studentas a temporary student user/api/auth/login/teacheras a temporary teacher user
Attendance requests create an attendance record and then send an HR verification email. If SMTP variables are missing, email delivery is skipped and the request will fail.
IP capture is implemented, but the geolocation helper is still a placeholder. Verification logs currently store derived values like Location for <ip> unless you wire in a real lookup provider in lib/utils/ip.ts.
vercel.json currently defines three cron jobs:
/api/scheduled/attendanceReportsat30 3 1,16 * */api/scheduled/completed-internshipsat0 2 */2 * */api/scheduled/active-internshipsat0 2 */2 * *
What they do:
attendanceReports: emails a CSV report of the last 15 days of verification activity to all teacherscompleted-internships: marks expired active internships asCOMPLETEDactive-internships: activates approved internships whose date range has started
In production, these routes expect Authorization: Bearer <CRON_SECRET> or the matching cron secret header where implemented.
//student/signup/student/login/student/dashboard/teacher/signup/teacher/login/teacher/dashboard/teacher/analytics
Authentication:
POST /api/auth/signupPOST /api/auth/login/studentPOST /api/auth/login/teacherPOST /api/auth/logoutGET /api/auth/me
Internships and attendance:
POST /api/internship-formGET /api/internship-formPATCH /api/internship-form/[id]/approvePOST /api/attendance/requestGET /api/attendance/verify
Teacher/admin data:
GET /api/users/teachersGET /api/logsGET /api/analyticsGET /api/dept-coordinatorPOST /api/dept-coordinatorPUT /api/dept-coordinator/[id]DELETE /api/dept-coordinator/[id]
Scheduled:
GET /api/scheduled/attendanceReportsPOST /api/scheduled/attendanceReportsGET /api/scheduled/completed-internshipsGET /api/scheduled/active-internships
pnpm dev
pnpm build
pnpm start
pnpm lintNotes:
pnpm buildrunsprisma generatebefore the Next.js build- There is no automated test script configured in
package.jsonright now
This app is set up well for Vercel-style deployment with a managed PostgreSQL database.
Before deploying:
- Provision PostgreSQL and set
DATABASE_URL - Set
JWT_SECRET - Configure SMTP credentials if you want attendance and report emails to work
- Set
NEXT_PUBLIC_BASE_URLto the deployed site URL - Set
CRON_SECRETso scheduled routes are protected - Run Prisma migrations against the production database
- IP geolocation is still a placeholder integration
- Middleware currently protects dashboard routes, not every teacher page
- The repository contains both
pnpm-lock.yamlandpackage-lock.json; use one package manager consistently in local development