YTNotes is a FastAPI app for turning YouTube videos into structured notes with folders, subscriptions, and AI-powered features.
Before starting the app, make sure these services are available:
- Python 3.13
- PostgreSQL
- Redis
- Google OAuth credentials
- Optional: ngrok for OAuth callback and Paddle webhook testing
- Optional: OpenAI API key for chat and note generation
- Optional: SmartProxy credentials for YouTube transcript extraction
- Optional: Paddle sandbox credentials for subscription testing
-
Clone the repository and enter it.
git clone <your-github-repo-url> cd ytnotes
-
Install the Python dependencies.
uv sync
-
Start PostgreSQL and Redis locally.
Make sure PostgreSQL is running and the database named
ytnotesexists. Also start Redis onlocalhost:6379. -
Configure your environment variables.
Update
.envor.env.localwith your local values. At minimum, you need:DATABASE_URLSECRETJWT_SECRETJWT_ALGOACCESS_TTL_MINREFRESH_TTL_MINGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETOPENAI_API_KEYSMART_PROXY_USERNAMESMART_PROXY_PASSWORDSUBSCRIPTION_GUARD_ENABLED(setfalsewhile developing)PADDLE_ENV(sandboxorproduction)PADDLE_API_KEYPADDLE_WEBHOOK_SECRETPADDLE_CLIENT_TOKENPADDLE_MONTHLY_PRICE_IDPADDLE_YEARLY_PRICE_IDPADDLE_MONTHLY_AMOUNT(in cents, e.g.1900)PADDLE_YEARLY_AMOUNT(in cents, e.g.19900)PADDLE_CURRENCY(e.g.USD)
If you are testing through ngrok, set
BASE_URLto the ngrok HTTPS URL. -
Run database migrations.
uv run alembic upgrade head
-
Start the application.
uv run fastapi dev main.py
If you prefer Uvicorn directly, this also works:
uv run uvicorn main:app --reload
-
Open the app in your browser.
By default the app runs at
http://127.0.0.1:8000.
- Google OAuth: required for login.
- ngrok: required if your Google OAuth redirect URL or Paddle webhook needs a public HTTPS endpoint.
- Paddle sandbox: required if you want to test subscription purchase or cancellation flows.
- OpenAI API: required for AI note generation and chat.
- SmartProxy: required for YouTube transcript extraction when direct transcript access is blocked.
- The app uses Redis to store and revoke auth tokens.
- The app uses Alembic for database migrations.
- If you change
BASE_URL, make sure the OAuth redirect URI matches${BASE_URL}/auth/callback.