🎯 A distraction-free YouTube learning platform with Google services integration
Features • Tech Stack • Getting Started • Deployment • Contributing
|
|
|
|
Designed for OLED screens with a minimal, eye-friendly dark interface.
Background: oklch(0 0 0) ████████ Pure Black
Card: oklch(0.06 0 0) ████████ Subtle Gray
Border: oklch(0.15 0 0) ████████ Soft Border
|
Next.js 16 |
TypeScript |
Tailwind 4 |
Prisma 7 |
PostgreSQL |
Vercel |
| Category | Technologies |
|---|---|
| Framework | Next.js 16 (App Router, Turbopack) |
| Language | TypeScript 5.x |
| Styling | Tailwind CSS 4.x, Radix UI, shadcn/ui |
| Database | PostgreSQL (Vercel Postgres) |
| ORM | Prisma 7 with Driver Adapters |
| Auth | NextAuth.js v5 (Auth.js) |
| APIs | Google APIs (YouTube, Drive, Calendar, Tasks, Classroom) |
| Video | react-youtube |
- Node.js 18+
- pnpm (recommended) or npm
- PostgreSQL database
- Google Cloud Console project
git clone https://github.com/ashwin-r11/deepfocus.git
cd deepfocuspnpm install
# or
npm installcp .env.example .envEdit .env with your credentials:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/deepfocus"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key" # Generate: openssl rand -base64 32
# Google OAuth
GOOGLE_CLIENT_ID="your-client-id"
GOOGLE_CLIENT_SECRET="your-client-secret"npx prisma generate
npx prisma db pushpnpm dev
# or
npm run devOpen http://localhost:3000 🎉
📋 Step-by-step guide
- Go to Google Cloud Console
- Create a new project or select existing
- Enable the following APIs:
- ✅ YouTube Data API v3
- ✅ Google Drive API
- ✅ Google Calendar API
- ✅ Google Tasks API
- ✅ Google Classroom API
- Go to APIs & Services → OAuth consent screen
- Choose External user type
- Fill in app information:
- App name:
DeepFocus - User support email: Your email
- Developer contact: Your email
- App name:
- Add scopes:
openid email profile https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/tasks https://www.googleapis.com/auth/classroom.courses.readonly - Add test users (required while in testing mode)
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Application type: Web application
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google https://your-domain.vercel.app/api/auth/callback/google - Copy Client ID and Client Secret to
.env
-
Import project on Vercel
-
Create Postgres database:
- Go to Storage → Create Database → Postgres
- Copy the
DATABASE_URL
-
Set environment variables:
Variable Description DATABASE_URLVercel Postgres connection string NEXTAUTH_URLhttps://your-app.vercel.appNEXTAUTH_SECRETRandom 32-char secret GOOGLE_CLIENT_IDFrom Google Cloud Console GOOGLE_CLIENT_SECRETFrom Google Cloud Console -
Update Google Console with production redirect URI
-
Deploy! 🚀
deepfocus/
├── 📂 app/ # Next.js App Router
│ ├── 📂 api/ # API routes
│ │ ├── 📂 auth/ # NextAuth endpoints
│ │ ├── 📂 playlists/ # Playlist CRUD
│ │ ├── 📂 watch-history/ # Progress tracking
│ │ └── 📂 youtube/ # YouTube API proxy
│ ├── 📂 watch/[id]/ # Video player page
│ ├── 📄 layout.tsx # Root layout
│ └── 📄 page.tsx # Home page
├── 📂 components/ # React components
│ ├── 📂 ui/ # shadcn/ui components
│ ├── 📄 video-stage.tsx # Video player
│ ├── 📄 notepad.tsx # Note-taking
│ ├── 📄 playlist-modal.tsx # Playlist manager
│ └── 📄 tools-panel.tsx # Side panel
├── 📂 lib/ # Utilities
│ ├── 📄 auth.ts # NextAuth config
│ ├── 📄 prisma.ts # Database client
│ └── 📄 utils.ts # Helper functions
├── 📂 prisma/ # Database
│ └── 📄 schema.prisma # Data models
├── 📂 public/ # Static assets
└── 📄 package.json
erDiagram
User ||--o{ Account : has
User ||--o{ Session : has
User ||--o{ Playlist : creates
User ||--o{ Note : writes
User ||--o{ WatchHistory : tracks
Playlist ||--o{ PlaylistVideo : contains
User {
string id PK
string email
string name
string image
}
Playlist {
string id PK
string name
string userId FK
}
WatchHistory {
string id PK
string videoId
int progress
int duration
datetime lastWatched
}
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js - React Framework
- shadcn/ui - UI Components
- Prisma - Database ORM
- NextAuth.js - Authentication
- Vercel - Deployment Platform
Made with ❤️ by Ashwin



