Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"agentCanUpdateSnapshot": true,
"snapshot": "snapshot-20250608-c36a2efe-a6e1-4055-9384-a6476fcfd377"
}
}
8 changes: 8 additions & 0 deletions .cursor/notepads/ai-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,53 @@ description: Template for tracking and documenting AI tasks and progress
# AI Task Documentation

## Current Task

- [ ] Task Name:
- [ ] Description:
- [ ] Status: (Not Started | In Progress | Completed)
- [ ] Priority: (Low | Medium | High)

## Requirements

- [ ] Requirement 1
- [ ] Requirement 2
- [ ] Requirement 3

## Progress

- [ ] Step 1
- [ ] Step 2
- [ ] Step 3

## Files Modified

- [ ] File 1: Description of changes
- [ ] File 2: Description of changes
- [ ] File 3: Description of changes

## Testing

- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
- [ ] Edge cases considered

## Documentation

- [ ] Code comments added
- [ ] API documentation updated
- [ ] README updated if needed
- [ ] Architecture decisions documented

## Review

- [ ] Code follows project standards
- [ ] Security considerations addressed
- [ ] Performance impact considered
- [ ] Accessibility requirements met

## Notes

- Additional context
- Decisions made
- Future considerations
Expand Down
37 changes: 17 additions & 20 deletions .cursor/notepads/api-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,47 @@ description: Template for creating Next.js API routes with proper error handling
# API Route Template

## Basic Structure

```ts
import { NextResponse } from "next/server"
import { z } from "zod"
import { NextResponse } from "next/server";
import { z } from "zod";

// Input validation schema
const inputSchema = z.object({
// Define input fields
})
});

// Response type
type ApiResponse = {
data?: unknown
error?: string
}
data?: unknown;
error?: string;
};

export async function POST(req: Request) {
try {
// Parse and validate input
const body = await req.json()
const input = inputSchema.parse(body)
const body = await req.json();
const input = inputSchema.parse(body);

// Handle request
const result = await handleRequest(input)
const result = await handleRequest(input);

// Return success response
return NextResponse.json({ data: result })

return NextResponse.json({ data: result });
} catch (error) {
// Handle different error types
if (error instanceof z.ZodError) {
return NextResponse.json(
{ error: "Invalid input" },
{ status: 400 }
)
return NextResponse.json({ error: "Invalid input" }, { status: 400 });
}

console.error("API Error:", error)
return NextResponse.json(
{ error: "Internal server error" },
{ status: 500 }
)
console.error("API Error:", error);
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
}
}
```

## Best Practices

- Always validate input with Zod
- Use proper HTTP status codes
- Implement rate limiting for public routes
Expand All @@ -61,6 +56,7 @@ export async function POST(req: Request) {
- Document API endpoints

## Security Considerations

- Validate authentication
- Check authorization
- Sanitize inputs
Expand All @@ -70,6 +66,7 @@ export async function POST(req: Request) {
- Monitor for abuse

## Testing

- Add integration tests
- Test error cases
- Validate response formats
Expand Down
Loading
Loading