π― 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
β Star this repo β’ π Report Bug β’ β¨ Request Feature



