DomainScoreCursor Rules
GitHub

1/23/2025

A comprehensive guide and specifications for building a Todo application using Next.js and Supabase. This project leverages Supabase for backend services, Next.js for server-side rendering, and Tailwind CSS for styling.



# Next.js (Supabase Todo App)

# Next.js Supabase Todo Application

## Project Overview
This project is a Todo application built with Next.js and Supabase. It allows users to manage their tasks efficiently with a clean and responsive user interface. The application uses Supabase for authentication and database management, ensuring a secure and scalable backend.

## Key Features
- **User Authentication**: Secure login and signup using Supabase Auth.
- **Task Management**: Create, read, update, and delete tasks.
- **Responsive Design**: Built with Tailwind CSS for a fully responsive layout.
- **Real-time Updates**: Utilizes Supabase's real-time capabilities for instant updates.

## Project Specifications

### Coding Standards
- Use functional components and hooks.
- Prefer `const` over `let` for variable declarations.
- Follow camelCase for variable and function names, PascalCase for component names.

### Preferred Libraries
- **Next.js**: For routing and server-side rendering.
- **Supabase**: For backend services including database and authentication.
- **Tailwind CSS**: For styling and responsive design.

### File Structure
- `components/`: Reusable UI components.
- `pages/`: Next.js pages.
- `lib/`: Utility functions and Supabase client setup.
- `styles/`: Tailwind CSS configuration and global styles.

### Performance Optimization
- Use `React.memo` for pure components.
- Implement lazy loading for components.
- Optimize `useEffect` dependencies to prevent unnecessary re-renders.

### Testing Requirements
- Write unit tests using Jest and React Testing Library.
- Ensure test coverage is at least 80%.
- Use snapshot testing for UI components.

### Documentation
- Use JSDoc for function and component comments.
- Include PropTypes validation in components.
- Maintain a `README.md` in each main directory.
- Provide both English and Chinese versions of the `README.md`.

### Error Handling
- Use `try/catch` blocks for asynchronous operations.
- Implement a global error boundary component.

## Deployment
Deploy the application on Vercel for a seamless CI/CD experience. Ensure environment variables are correctly set up for Supabase credentials.

## Contribution
Contributions are welcome! Please follow the coding standards and ensure all tests pass before submitting a pull request.