Skip to content

Samie-ub/scrolldiet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Diet App

Digital Diet is an offline-first YouTube intake app designed to reduce doomscrolling. It removes feed/recommendation loops and enforces a constrained local queue: you must finish the current downloaded videos before requesting a new batch.

Core Idea

  • No algorithmic feed in the app.
  • You provide explicit source URLs (video/channel/playlist).
  • Videos are downloaded locally for offline playback.
  • Queue is locked while pending videos exist.
  • Any video duration is allowed.

Tech Stack

  • Backend: Python, FastAPI, yt-dlp, SQLite
  • Frontend: Tauri v2, React (Vite), HTML5 <video>

Repository Structure

/digital-diet-app
├── docs                 # Architecture, setup, API specs
├── progress             # Iteration logs and updates
├── issues               # Known issues and tracked items
├── skills_and_tools     # Dev helpers and scripts
├── src-backend          # FastAPI + yt-dlp + SQLite
│   ├── api
│   ├── core
│   ├── db
│   └── data
└── src-frontend         # Tauri React app
    ├── src-tauri
    ├── src
    └── public

How It Works

  1. Frontend sends intake request with sources and max_videos.
  2. Backend checks queue lock:
    • If pending videos exist (downloaded / in_progress), new intake is rejected.
  3. Backend uses yt-dlp to resolve and download videos locally.
  4. Frontend plays local files via backend stream endpoint.
  5. Progress updates mark videos in_progress and then completed.
  6. When all pending videos are completed, queue unlocks for the next batch.

Local Setup

Prerequisites

  • Python 3.11+
  • Node.js 20+
  • Rust toolchain (for Tauri)
  • ffmpeg in PATH (recommended)

Backend

cd src-backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

Frontend (Browser)

cd src-frontend
npm install
npm run dev -- --host 0.0.0.0 --port 5173

Frontend (Tauri Desktop)

cd src-frontend
npm install
npm run tauri dev

Mobile Access on Same Wi-Fi

Use the helper script:

./skills_and_tools/expose_mobile_access.sh

Or run both backend + frontend with one command:

./skills_and_tools/expose_mobile_access.sh --run-all

Then:

  1. Open the printed frontend URL on your phone.
  2. In the app, set Backend URL to the printed backend URL.

Main API Endpoints

Base URL: http://127.0.0.1:8000/api/v1

  • POST /intake/download
  • GET /queue/status
  • GET /videos?status=pending|completed|all
  • GET /videos/{id}
  • GET /videos/{id}/stream
  • POST /videos/{id}/progress
  • POST /videos/{id}/complete

Current Status

Implemented:

  • End-to-end intake/download/playback flow
  • Queue lock enforcement
  • Progress tracking and completion transitions
  • Per-source skip diagnostics in download responses
  • LAN-friendly CORS for mobile testing

Planned improvements:

  • Better retry/error surfacing for failed downloads
  • Stream range optimization for smoother seeking
  • Test coverage for queue and downloader edge cases

Documentation

About

An offline-first YouTube intake app designed to reduce doomscrolling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors