Git Product home page Git Product logo

aabounegm / cast Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 2.0 5 MB

A podcast listening progressive web app with all-around automated quality assurance

Home Page: https://cast-iu.pages.dev

License: MIT License

JavaScript 0.76% CSS 0.14% HTML 0.22% Svelte 19.68% TypeScript 78.90% Shell 0.29%
cypress feature-sliced jest lighthouse-ci owasp svelte sveltekit testing-library typescript uptime-monitor

cast's People

Contributors

aabounegm avatar alkaitagi avatar illright avatar khaledismaeel avatar vanishmax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

georg3103 freekos

cast's Issues

Set up lottery reviewing

Use this GitHub Action. Create an escape route to skip code review when a feature was pair-programmed.

Acceptance criteria:

  • every subsequent PR should have 1 person from the team assigned for review randomly after the CI checks pass
  • PRs with a pair-programmed label should not be affected.

Set up a CI checking workflow

Blocked by #9 and #10.

Acceptance criteria:

  • every PR is validated with pnpm run lint in the workspace root and pnpm run test:unit and pnpm run test:e2e in the app project
  • pnpm's dependencies are cached across workflow runs

Track listening history locally

Use svelte-persistent-writable. No need to track the entire history, a rolling history of 6 entries is sufficient.

Acceptance criteria:

  • The "Recently listened" section on the podcast gallery shows up to 6 recently listened podcasts
  • Listening history is persisted locally across page reloads

Move the `svelte-check` step to the `pre-push` hook

Steps:

  1. Remove the line that runs svelte-check from .husky/pre-commit
  2. Run pnpm exec husky add .husky/pre-push <that command from pre-commit that runs svelte-check>
    No need to mess around with permission bits

Configure uptime monitoring

Use Upptime.

Acceptance criteria:

  • a status page is available via GitHub Pages
  • badges of uptime percentage and response time are available in the README
  • a link to the status page is available in the README by clicking on badges
  • uptime alerts are sent to GitHub Issues

Design the podcast gallery screen

Acceptance criteria:

  • displays the available podcasts in a grid
  • each podcast is represented with a cover art, a title and the authors
  • has a way to view liked podcasts

Artifacts:

  • a Figma link with the design

Fetch a list of podcasts with their meta-information

Integrate with the Supabase backend to fetch a list of all podcasts with all of their meta information and the URL to the audio file. For now, just dump it as JSON somewhere.

Acceptance criteria:

  • Every podcast from Supabase is fetched along with all of its meta information (we'll filter it out later)
  • No private tokens are leaked in the client build
  • Fetching works on both the main deployment and the preview deployments (on subdomains of cast-iu.pages.dev)
  • The data is fetched in the format of proposed TS interfaces

Interfaces:

interface Podcast {
  id: number;
  title: string;
  author: string;
  coverUrl: string;
  episodes: Episode[];
}

interface Episode {
  id: number;
  title: string;
  duration: number;
  audioUrl: string;
  favorite?: boolean;  // omit this field for now
}

Fix the linting command to fail if any of the subcommands fail

Currently, the lint script runs 3 things, chaining them with ;. In shell terms this means "disregard the exit code of the first 2 commands and use the exit code of the last command as the final exit code". Hence, when ESLint or Prettier fail, but svelte-check passes, we get a passing workflow.

An obvious solution would be to chain the commands with &&, but the problem with that is that a failing command prevents all of the subsequent commands from running. When using the lint script locally, it's nice to see problems from all 3 tools to take parallel action.

Having said that, do some research for cool ways to propagate non-zero exit codes without breaking the command chain. Maybe something in shell syntax or some package from npm. If nothing fits, fall back to &&.

Construct the bottom bar

Blocked by #26. No animation is required, no drag-to-close functionality either. The markup of the bar has already been provided by @alkaitagi.

Acceptance criteria:

  • It should look identical to the proposed design
  • It should feature links to navigate to "Podcast Gallery" and "Your Library" pages
  • It should indicate what page the user is currently on (Podcast Episodes is a sub-page of the two pages I mentioned previously)
  • It should indicate whether an episode is currently loaded for playing
  • It should open the Now Playing widget over the current page by clicking the mini-player
  • It should close the Now Playing widget by clicking on the "chevron down" icon
  • It should be a part of the layout (meaning it should appear on every page)

Construct the Now Playing page

Implement the layout proposed in #27. Delegate the styling of audio controls to #40.

Acceptance criteria:

  • The widget and its elements should adhere to Feature Sliced Design
  • The page should reside at /now-playing outdated
  • A link to this page should be available on the home page outdated
  • The widget should look identical to the proposed design

Initialize a sli.dev template

Blocked by #1

Create a sli.dev boilerplate in the presentation project.

Acceptance criteria:

  • pnpm dev in the presentation project starts sli.dev in dev mode

Configure CD to Cloudflare Pages

Acceptance criteria:

  • The hostname of the app should be cast-iu.pages.dev (cast is already taken)
  • A URL to the app should be added to the top of the README
  • Every PR should generate a preview deployment on a subdomain of the original hostname
  • Every commit to main that passes static checks and test suites should update the main deployment

Configure Supabase to serve a sample podcast

A podcast should be a streamable audio file. In the future, we will add support for transcripts of podcasts, so watch out for that.

We can take a sample audio file from MixKit.

Acceptance criteria:

  • An app is created on Supabase
  • A link is created to fetch a sample audio file

Artifacts:

  • A link to the audio file

Add `svelte-check` to the pre-commit hook

Currently, our pre-commit hook checks for ESLint issues and formatting problems. However, TypeScript errors go through freely. Remedy that by adding a pnpm exec svelte-check [...] to the .husky/pre-commit file.

P.S. Also an embarrassing detail: our pre-commit hook doesn't even run currently because it's not marked as executable. Please, mark it as executable while you're at it.

Configure Prettier project-wide

Blocked by #2

Acceptance criteria:

  • pnpm lint in the workspace root checks all supported files with Prettier and then runs lint in app.
  • pnpm fix in the workspace root tries to fix all formatting issues and then runs fix in app.

Create the presentation 1

Blocked by #3

Presentation 1 presents the team, describes the project that we will be building, its features, the tech stack, our ambitions regarding Quality, Reliability and Security. Should also mention what we've done over these two weeks.

Acceptance criteria:

  • pnpm dev in the presentation project opens the presentation
  • Slides have presenter notes to highlight key points of what to talk about during this slide

Set up a multi-project workspace with `pnpm`

Which is a fancy way of saying "create pnpm-workspace.yaml". Create empty projects for the podcast app and the presentation.

Acceptance criteria:

  • pnpm detects that there are two projects in the workspace
  • The projects are named app and presentation
  • Each project contains a package.json

Construct the Podcast Episodes screen

Blocked by #39.

Implement the layout proposed in #29.

Acceptance criteria:

  • The page and its elements should adhere to Feature Sliced Design
  • The page should reside at /podcasts/:podcast-id
  • A link to this page should be available on the home page for every podcast fetched from Supabase outdated
  • The page should look identical to the proposed design

Set up Husky and lint-staged

Blocked by #12

This is to ensure that no code that violates static checkers can be committed.

Acceptance criteria:

  • Formatting issues and ESLint problems in staged files should prevent Git from making commits
  • Git hooks should be installed automatically upon running pnpm i (out of the box in Husky)

Run Jest in CI mode in CI

Jest has a --ci option that prevents creation of snapshots โ€” those should only be created manually. Add this parameter to the code that runs our unit tests in CI. Don't forget that pnpm run requires an extra -- to denote that the following arguments will be passed to the command that's running.

Design the audio controls screen

Acceptance criteria:

  • features play/pause, jumps backward and forward, a scrubbing bar
  • displays the podcast cover art
  • displays the podcast name and authors
  • has a way to view transcripts
  • has a button to "like" the episode

Artifacts:

  • a Figma link with the design

Move away from storing an HTMLAudioElement in the store to specific value stores

All of these should be implementable without much code by simply bind:ing to the corresponding attributes on the <audio> tag, so blocked by #69.

Acceptance criteria:

  • entities/audio exposes a writable store for currentTime that defaults to 0
  • entities/audio exposes a readable store for duration that defaults to NaN
  • entities/audio exposes a writable store for playbackRate that defaults to 1
  • entities/audio exposes a writable store for paused that defaults to true
  • There should no longer be a store that allows direct access to the <audio> DOM node
  • These stores should be wired up to the controls in features/playback-controls

Get rid of the presentation

That probably means we no longer require a monorepo, so we should merge the package.json of app and the root.

Acceptance criteria:

  • the presentation source code is no longer in the repo
  • the monorepo is demolished
  • no pnpm-workspace.yaml is present in the repo
  • the workflow of deploying the presentation is disabled

Display the podcasts from the backend

Partially blocked by #58.

Acceptance criteria:

  • The Podcast Gallery screen is wired up to the data from the backend
    • All podcasts are listed at the bottom
    • The Trending Now section should be removed for now
    • The Recently Listened section will be populated by data from #58
  • The Podcast Episodes screen shows episodes of each podcast

Make the README cooler

Acceptance criteria:

  • has a link to the live demo
  • has a feature-sliced badge
  • has a listing of main features
  • has screenshots (Figma exports will work for now)
  • has local running instructions
  • has a section on QA (tools and techniques used)
  • has a mention of the license
  • has an introduction to the dev team

Initialize a SvelteKit template

Blocked by #1

Create a SvelteKit boilerplate in the app project with TypeScript. No Prettier, but with ESLint and svelte-check.

Acceptance criteria:

  • pnpm dev in the app project starts a SvelteKit application
  • pnpm lint in the app project runs ESLint on Svelte and TS and then svelte-check on Svelte
  • pnpm fix in the app project runs ESLint on Svelte and TS in fixing mode

Bind the audio to a physical `<audio>` element on the page

Without it, we cannot detect playing audio with Cypress.

Acceptance criteria:

  • An actual <audio> node is present in the global __layout.svelte
  • The audio store is bound to that instance
  • The assertion in the integration tests that checks for playing audio is restored
  • The integration tests pass

Track liked episodes locally

Partially blocked by #42. Use svelte-persistent-writable.

Acceptance criteria:

  • The likes are restored after a page reload within a single browser
  • The like button works on the Now Playing page
  • New likes are written to the localStorage
  • Liked episodes are marked prominently on the Podcast Episodes page
  • Your Library page displays the podcasts that have liked episodes

Design the episodes screen

Acceptance criteria:

  • it shows the podcast title and authors
  • it shows how many episodes are available
  • it lists the episodes along with their titles
  • every episode has a visible duration
  • liked episodes are marked prominently
  • downloaded episodes are marked prominently
  • each episode has a way to be downloaded
  • there's a way to download all episodes

Artifacts:

  • a Figma link with the design

Configure coverage reports

Per the course requirements, we must have 60% statement coverage for our project. Let's set up Codecov to enforce this threshold.

Acceptance criteria:

  • Codecov is configured to require 60% of threshold
  • a badge of coverage is added to the README, linking to the detailed coverage information
  • CI gathers and uploads coverage information

Set up auto-deploying of the presentation

Blocked by #6

This should run on each commit to main that made changes to any of the files in the presentation project. It should run after the CI for the main branch successfully passes. The deployment should be made to /presentation.

Acceptance criteria:

  • A URL to the presentation should be added to the README.
  • A presentation should be accessible at that URL.

Set up podcast fetching on the frontend

Blocked by #10

We should have an input field that you can enter a URL into (no validation) and that URL is fetched to return an audio file embedded with a native <audio> element with controls.

Acceptance criteria:

  • The input is present on /
  • The audio element on every route (that is, in the layout)
  • The audio element is disabled when there's no music selected
  • The interaction flow with the component is covered with e2e tests

Remember about Feature Sliced Design. I'm ready to discuss the architecture if you happen to have any doubts.

Set up audio controls

This should probably be a single component, a feature in terms of Feature Sliced Design.

Acceptance criteria:

  • it allows pausing/resuming playback
  • it allows jumping forward 30s
  • it allows jumping backward 10s
  • it allows scrubbing
  • it is integrated with the <audio> element that is in the layout (i.e. it doesn't add its own <audio> element)
  • it is covered with unit tests

P.S. don't spend too much time styling, just use plain HTML

Create a Gantt chart

Acceptance criteria:

  • all 5 features are reflected in it
  • unit testing, e2e testing are planned in parallel with feature development
  • stress testing is planned at the end
  • final project presentation is planned

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.