Skip to content

Refactor Backend Error Handling & Database Integrity #69

Description

@navin-oss

The backend currently exposes internal error details and lacks proper database constraints and transactional safety. This may lead to security leaks, orphaned records, and inconsistent classroom/member data.


Tasks

  • Sanitize API error responses
  • Hide stack traces in production
  • Add centralized error handling utility
  • Add foreign key constraints
  • Add CASCADE DELETE support
  • Wrap multi-step DB operations in transactions
  • Add missing unique constraints

Files Involved

  • configs/schema.ts
  • configs/db.tsx
  • lib/auth-utils.ts
  • Classroom-related API routes

Labels

GSSoC26 backend database bug


Expected Outcome

  • Improved backend security
  • Better database integrity
  • Reduced risk of orphaned records
  • Consistent transactional behavior
  • Cleaner and safer API responses

assign it to me

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions