├── static └── styles.css ├── app ├── deps.ts ├── test │ ├── common.ts │ ├── data │ │ ├── expectedCaptionsUrl.txt │ │ ├── successfulYoutubeCaptionsResponse.xml │ │ └── successfulYoutubeDataResponse.html │ ├── get-captions-summary.test.ts │ └── get-youtube-video-summary.test.ts └── src │ ├── failure.ts │ ├── result.ts │ ├── fetch-youtube-data.ts │ ├── get-captions-summary.ts │ ├── get-youtube-video-summary.ts │ ├── summarize-captions-with-chat-gpt.ts │ ├── app-config.ts │ └── get-youtube-captions.ts ├── .vscode ├── extensions.json ├── settings.json └── tailwind.json ├── tailwind.config.ts ├── fresh.config.ts ├── dev.ts ├── .gitignore ├── components ├── Label.tsx ├── GoBackHomeButton.tsx ├── Input.tsx ├── Button.tsx ├── Header.tsx ├── Summary.tsx └── ErrorPage.tsx ├── routes ├── _404.tsx ├── _app.tsx ├── index.tsx └── summary │ └── youtube.tsx ├── main.ts ├── .github └── workflows │ └── test.yaml ├── fresh.gen.ts ├── run.ts ├── test └── main-test.test.ts ├── deno.json ├── README.md └── deno.lock /static/styles.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /app/deps.ts: -------------------------------------------------------------------------------- 1 | export { APIError, OpenAI } from "https://deno.land/x/openai@v4.27.0/mod.ts"; 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "denoland.vscode-deno", 4 | "bradlc.vscode-tailwindcss" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /app/test/common.ts: -------------------------------------------------------------------------------- 1 | export const createPromise = (data: T): Promise => ( 2 | new Promise((resolve) => resolve(data)) 3 | ); 4 | -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import { type Config } from "tailwindcss"; 2 | 3 | export default { 4 | content: [ 5 | "{routes,islands,components}/**/*.{ts,tsx}", 6 | ], 7 | } satisfies Config; 8 | -------------------------------------------------------------------------------- /fresh.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "$fresh/server.ts"; 2 | import tailwind from "$fresh/plugins/tailwind.ts"; 3 | 4 | export default defineConfig({ 5 | plugins: [tailwind()], 6 | }); 7 | -------------------------------------------------------------------------------- /dev.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S deno run -A --watch=static/,routes/ 2 | 3 | import dev from "$fresh/dev.ts"; 4 | import config from "./fresh.config.ts"; 5 | 6 | import "$std/dotenv/load.ts"; 7 | 8 | await dev(import.meta.url, "./main.ts", config); 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | TODO.md 2 | 3 | # dotenv environment variable files 4 | .env 5 | .env.development.local 6 | .env.test.local 7 | .env.production.local 8 | .env.local 9 | 10 | # Fresh build directory 11 | _fresh/ 12 | # npm dependencies 13 | node_modules/ 14 | 15 | cov/ 16 | -------------------------------------------------------------------------------- /components/Label.tsx: -------------------------------------------------------------------------------- 1 | import { JSX } from "preact"; 2 | 3 | export function Label(props: JSX.HTMLAttributes) { 4 | return ( 5 |