Skip to content

varun3011/opt_timeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OPT Timeline β€” F-1 Immigration Manager

A web app for F-1 international students to track OPT and STEM OPT deadlines, unemployment days, and stay on top of their immigration status.

πŸš€ Live Demo: opt-timeline-app.vercel.app


Features

  • Dashboard β€” Real-time OPT status, days remaining, and smart alerts
  • Timeline β€” Visual timeline of your OPT and STEM extension dates
  • Unemployment Tracker β€” Log periods and get warned before hitting the 90/150-day limit
  • STEM Extension β€” Track your STEM OPT application and dates
  • Analytics β€” Detailed breakdown of days used, remaining, and progress
  • AI Assistant β€” Ask immigration questions powered by OpenAI
  • Email Notifications β€” Daily reminders for upcoming deadlines via Resend
  • Google OAuth β€” Sign in with your Google account

Tech Stack

Layer Tech
Framework Next.js 16 (App Router)
Language TypeScript
Styling Tailwind CSS v4 + Radix UI
Database PostgreSQL (Neon)
ORM Prisma v7
Auth NextAuth v5 (Google OAuth)
AI OpenAI API
Email Resend
Deployment Vercel

Getting Started

1. Clone the repo

git clone https://github.com/YOUR_USERNAME/opt-timeline.git
cd opt-timeline

2. Install dependencies

npm install

3. Set up environment variables

cp .env.example .env

Fill in your .env file β€” see Environment Variables below.

4. Set up the database

npx prisma migrate dev

5. Run the dev server

npm run dev

Open http://localhost:3000


Environment Variables

Variable Description
DATABASE_URL PostgreSQL connection string (e.g. from Neon)
AUTH_SECRET Random secret β€” generate with openssl rand -hex 32
AUTH_URL Your app URL (e.g. http://localhost:3000)
AUTH_GOOGLE_ID Google OAuth client ID
AUTH_GOOGLE_SECRET Google OAuth client secret
RESEND_API_KEY API key from Resend
RESEND_FROM_EMAIL Sender email address
OPENAI_API_KEY API key from OpenAI
NEXT_PUBLIC_APP_URL Your public app URL
CRON_SECRET Secret to protect cron endpoint β€” generate with openssl rand -hex 32

Setting up Google OAuth

  1. Go to Google Cloud Console β†’ APIs & Services β†’ Credentials
  2. Create an OAuth 2.0 Client ID (Web application)
  3. Add authorized redirect URI: http://localhost:3000/api/auth/callback/google
  4. Copy the client ID and secret to your .env

Deployment

Deploy to Vercel

npm i -g vercel
vercel --prod

Add all environment variables in Vercel Dashboard β†’ Settings β†’ Environment Variables.

Add your production URL to Google OAuth authorized redirect URIs:

https://your-app.vercel.app/api/auth/callback/google

Project Structure

app/
β”œβ”€β”€ (app)/              # Protected app routes
β”‚   β”œβ”€β”€ dashboard/      # Main dashboard
β”‚   β”œβ”€β”€ timeline/       # Visual timeline
β”‚   β”œβ”€β”€ unemployment/   # Unemployment log
β”‚   β”œβ”€β”€ stem/           # STEM extension
β”‚   β”œβ”€β”€ analytics/      # Analytics page
β”‚   β”œβ”€β”€ ai-assistant/   # AI chat
β”‚   └── notifications/  # Notification settings
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ auth/           # NextAuth handlers
β”‚   β”œβ”€β”€ ai-chat/        # OpenAI endpoint
β”‚   β”œβ”€β”€ cron/           # Daily notification job
β”‚   β”œβ”€β”€ onboarding/     # Save OPT dates
β”‚   β”œβ”€β”€ stem/           # STEM extension API
β”‚   └── unemployment/   # Unemployment log API
β”œβ”€β”€ sign-in/            # Sign in page
└── onboarding/         # First-time setup

lib/
β”œβ”€β”€ opt-engine.ts       # Core timeline calculation logic
β”œβ”€β”€ prisma.ts           # Prisma client
└── notifications.ts    # Email notification logic

prisma/
└── schema.prisma       # Database schema

License

MIT

About

🧭 OPT Timeline β€” F-1 Immigration Tracker Track OPT/STEM OPT deadlines, unemployment days, and immigration status with alerts, analytics, and AI assistance. Built with Next.js, Prisma, PostgreSQL. πŸ”— opt-timeline-app.vercel.app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages