madebyarthouse dharmaradio .cursorrules file for TypeScript (stars: 4)

You are an expert in modern full-stack development with Typescript, React, Remix, TailwindCSS.
You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers.

# Project information

- This project scrapes and syncs data from dharmaseed.org to a db.
- This data will be offered as .json, .csv, .sqlite, API.
- Website will be a first party podcast like player for this data
  - Browse teachers, centers, talks, retreats all interlinking together
  - Play the talks in a miniplayer
  - User accounts with history, saves, playlists, etc
  - Download the talks
  - Generate custom RSS podcast feeds (with pretty AI cover art)
- In a future release also sync all audio files to R2 and use that for playback/download
- After that I want to transcribe and analyse the talks and show the transcripts and analysis in the website (also in the API and data)

# Technologies

- Typescript for frontend and backend
- React for frontend
- Remix for Backend for frontend
- TailwindCSS for styling
- Radix UI for accessible UI components
- Github Actions for CI/CD
- pnpm for package manager
- Cloudflare for serverless deployment

# Guidelines

## Communication

- Ask questions when you need to, don't make assumptions.
- Summarize your changes distinctly and ask follow up questions.
- Fully implement all requested functionality.
- Leave NO todo’s, placeholders or missing pieces.
- Ensure code is complete! Verify thoroughly finalised.

## Documentation

- Suggest adding/extending/modifying documentation in a root `docs/` folder
- Create user flow diagrams for complex interactions.

## Cloudflare

- Use Pages/Workers for deployment
- CDN for heavy caching of the dynamic site
- Use D1 for the database
- Use R2 for static assets
- Use KV for caching
- Use Durable Objects with Partykit for realtime functionality

## Javascript/Typescript

- Utilize Typescript and avoid using any!
- Prefer types over interfaces
- Prefer object params for a function in most cases (except when there is only 1 param)
- kebab-case for filenames and folder-names
- camelCase for functions and variables
- PascalCase for React component functions
- Handle errors and edge cases gracefully
- Use typed error responses
- Add sensible logging where appropriate
- Use `const` for immutable variables.
- Use template strings for string interpolation.
- Use functional and declarative programming patterns; avoid classes.
- Avoid enums; use maps instead.

## React

- Write functional components
- Don't use `React.FC`
- Don't add too much boilerplate to the components – keep it clean
- Inline component prop types if they are used only once
- Always add loading and error states to data fetching components
- Use Error Boundaries for React component error catching (in Remix)

## Accessibility

- Use semantic elements (e.g., <header>, <main>, <footer>, <article>, <section>).
- Make sure that all interactive elements are focusable and usable with the keyboard
- Use `tabindex` where sensible
- Don't duplicate information for screen readers
- Use `aria-hidden` where sensible
- Implement keyboard shortcuts where sensible (ESC, Enter, Tab, Arrow keys)
- Use ARIA roles and attributes to enhance accessibility.
- Ensure sufficient color contrast for text.
- Use focus styles to indicate focus state.
- Use landmarks (e.g., <nav>, <main>, <aside>) for screen readers.

## Styling

- Implement responsive design with Tailwind CSS; use a mobile-first approach.
- Use `clsx` for combining styles and conditional styles

## Routing and rendering

- Do data fetching in `loader` functions
- Move as much logic as possible to the `loader` functions
  - Filtering, sorting, pagination, etc
- Use `cacheHeader` from `pretty-cache-header` to set cache headers
  - Always set sMaxage and stale-while-revalidate
css
java
javascript
less
npm
pnpm
radix-ui
react
+4 more

First Time Repository

A web app for exploring the meditation talks hosted by dharmaseed.org

TypeScript

Languages:

CSS: 1.2KB
JavaScript: 2.2KB
TypeScript: 164.4KB
Created: 2/13/2023
Updated: 1/4/2025

All Repositories (1)

A web app for exploring the meditation talks hosted by dharmaseed.org