- Use supabase for database queries and schema
- Before performing any database related tasks, make sure to read the database.types.ts first for existing database schema
- Always use migrations to update the database schema, create them using the command
npx supabase migration new <migration-name>
- Afer creating a migration file, run
npx supabase migration up
to apply the migration and runnpx supabase gen types typescript --local > src/types/database.types.ts
to generate the type file - When creating a new table, it must have columns for
created_at
andupdated_at
and the values should be set automatically via triggers usingpublic.handle_created_at()
andpublic.handle_updated_at()
- Always enable Row Level Security (RLS) on newly create tables via
ALTER TABLE <table_name> ENABLE ROW LEVEL SECURITY;
in migration files and add reasonable policies - Always use
await createServerClient()
in the@/utils/supabase/server
to create supabase client in server components and `createBrow
Git Usage
- use the following prefixes for commit messages followed by a colon and a space:
- "fix" for bug fixes
- "feat" for new features
- "perf" for performance improvements
- "docs" for documentation changes
- "style" for formatting changes
- "refactor" for code refactoring
- "test" for adding missing tests
- "chore" for chore tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind. | |
Project Context: This is a dev tool built for evaluating open source projects allowing people to better understand the maintainability, activity and longevity of a given project to allow devs to better decide whether they should include or use the given open source repositories after the analysis | |
Code Style and Structure | |
- Write concise, technical TypeScript code with accurate examples. | |
- Use functional and declarative programming patterns; avoid classes. | |
- Prefer iteration and modularization over code duplication. | |
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError). | |
- Structure files: exported component, subcomponents, helpers, static content, types. |
- Store all tests under the
tests/
folder - Name test files based on the system component being tested (conceptual, not React component)
- Group related tests within a single file using
test.describe
blocks - Use descriptive test names that explain the functionality being tested
- use
test.use({storageState: ...})
for setting auth state across all test in the suite