Tom-BUXDAO BUX-BOT .cursorrules file for PLpgSQL

# BUX DAO NFT Verification Project Rules

## File Organization
- Place React components in /components
- Place API routes in /pages/api
- Place page components in /pages
- Place styles in /styles
- Place utilities in /utils
- Place database scripts in /scripts
- Place types and interfaces in /types
- Place environment variables in .env.local

## Database Structure
- Users can have multiple wallets
- NFTs track full sales history
- NFTs include rarity and rank data
- Token balances are wallet-specific
- All tables maintain audit timestamps
- All data changes are tracked
- All relationships are properly indexed
- All queries are optimized

## Database Verification
- Use database-first verification
- Avoid external API calls when possible
- Implement proper rate limiting
- Use connection pooling
- Add retry logic for failures
- Maintain data integrity
- Use transactions for atomic operations
- Log all verification attempts

## Naming Conventions
- Use PascalCase for component files (UserProfile.tsx)
- Use camelCase for utility files (verifyHolder.ts)
- Use kebab-case for CSS modules (role-info.module.css)
- Use SCREAMING_SNAKE_CASE for environment variables

## Code Style
- Use TypeScript for all .ts and .tsx files
- Use CSS Modules for styling
- Use async/await for asynchronous code
- Use proper error handling with try/catch
- Add type definitions for all props and functions

## Database
- Use Prisma for all database operations
- Keep schema.prisma up to date
- Use migrations for schema changes
- Add comments for complex queries
- Maintain data integrity with triggers
- Track historical data changes
- Use proper indexing
- Optimize query performance

## API
- Use rate limiting for external APIs
- Add proper error handling
- Use typed responses
- Document API endpoints
- Cache frequent queries
- Validate all inputs
- Log all requests

## Components
- Keep components small and focused
- Use proper prop typing
- Add JSDoc comments for complex components
- Follow React best practices

## Scripts
- Add descriptive console output
- Include error handling
- Add retry logic for API calls
- Document usage in README.md
- Add data validation
- Log all operations
- Use batching for bulk operations

## Environment Variables
- Never commit .env files
- Keep .env.example updated
- Use strong typing for env vars
- Document all required variables

## Git
- Use meaningful commit messages
- Keep commits focused and atomic
- Don't commit sensitive data
- Update README.md for new features
css
javascript
plpgsql
prisma
react
typescript

First Time Repository

PLpgSQL

Languages:

CSS: 16.6KB
JavaScript: 0.3KB
PLpgSQL: 4104.1KB
TypeScript: 118.8KB
Created: 11/23/2024
Updated: 12/14/2024

All Repositories (1)