How gwaliorkilla-ctrl/grievance-portal-backend works
This is a grievance-portal API for submitting complaints with PDF documents, listing complaints with filters and pagination, retrieving a complaint, and resolving it by deletion. The principal submission flow validates request fields and the uploaded PDF, stores the document, then records its URL and complaint details. Listing, lookup, and deletion are separate service operations. The README provides no implementation details; the map follows the sampled source, with external Supabase resources shown as dependencies.
Main entry points: complaint.service.js Complaint service · complaint.routes.js Complaint routes · complaint.controller.js Request handling · app.js Express app
Components 10
HTTP API
- Server entry
index.js - Express app
src/app.js - Complaint routes
src/routes/complaint.routes.js - PDF upload filter
src/middlewares/upload.js
Complaint operations
- Request handling
src/controllers/complaint.controller.js - Complaint service
src/services/complaint.service.js
Persistence
- Supabase client
src/config/supabase.js - Complaints table
- Complaint documents
Other components
- API client
Connections 10
- API client → Express app: sends requests
- Server entry → Express app: starts
- Express app → Complaint routes: mounts routes
- Complaint routes → PDF upload filter: filters PDF
- Complaint routes → Request handling: dispatches
- Request handling → Complaint service: calls operations
- Complaint service → Supabase client: uses client
- Complaint service → Complaint documents: uploads and removes files
- Complaint service → Complaints table: creates, queries, deletes
- Request handling → API client: returns responses