A step-by-step look at how a request travels through eSerbisyo, how each barangay’s data stays private, and what technology makes it all possible.
How data flows through the system
Imagine a request as a package traveling along a conveyor belt. Every stop on the belt has a clear purpose, and at each stop the package gets closer to its final form. Here is the full journey:
- Resident submits a request. Whether they fill out the form at home on a phone or a staff member types it in at the counter, the request enters the system the same way (as a structured digital record stored in the database).
- Request is stored securely. The system saves every detail the resident provided: their name, address, the document type, and any uploaded files. A unique tracking number is assigned so it can be found instantly later.
- Staff reviews the request. A barangay staff member opens the dashboard, sees the request in their queue, and checks whether the information is complete and accurate. They can request additional requirements if something is missing.
- Document is generated. Once approved, the system pulls the request data into a pre-built .docx template. The result is a clean, professional PDF (no hand-writing, no copy-pasting, no typos from retyping).
- QR code is attached. A unique QR code is stamped onto the document. This code links to a verification record stored only inside the system. Anyone who scans it can confirm the document is genuine in seconds.
- Resident downloads the document. The finished PDF appears in the resident’s account. They can download it, print it, or show it on their phone. The resident is notified the moment it is ready.
- Anyone can verify the document. A third party (an employer, a government office, a landlord) scans the QR code and sees the verification page confirming the document’s authenticity. No phone call needed.
The same path is followed whether the request started online or at the front desk. No data is re-entered at any step; once the information is captured, it flows automatically through review, generation, and delivery.
How each barangay stays separate (multi-tenant)
Think of eSerbisyo as an apartment building. The platform is the building itself, providing electricity (servers), plumbing (the database), and a front door (the login page). But each barangay lives in its own apartment. Every apartment has its own furniture, its own lock, and its own set of residents. One tenant can never walk into another tenant’s room.
In technical terms, every piece of data in the system (every request, every document, every staff account) is tagged with abarangay ID. When a staff member logs in, the system immediately knows which barangay they belong to, and every database query they trigger is filtered to show only that barangay’s records.
- Data isolation. Barangay A’s staff can never see Barangay B’s residents, requests, or documents (not through the dashboard, not through the API, not even through a direct database query). The filter is applied at the system level, not by the user.
- Separate settings. Each barangay configures its own document types, staff accounts, and approval rules. Changing settings in one barangay has zero effect on any other.
- Shared infrastructure, private data. All barangays share the same servers and codebase, which keeps costs low. But the data layer enforces strict boundaries, so one barangay’s activity never leaks into another’s.
Analogy in a nutshell
If eSerbisyo is a mall, each barangay has its own store. The mall provides the roof, the electricity, and the parking lot, but every store keeps its own inventory behind its own locked door. No store can reach into another store’s stock.
The technology stack, simply explained
You do not need a CS degree to understand the tools eSerbisyo uses. Here is a plain-language breakdown of each layer:
Front end (what you see)
The front end is built with React, a popular JavaScript library for building user interfaces. Think of it as the store display window (it is the part of the system that residents and staff interact with). It handles buttons, forms, dashboards, and page navigation.
Back end (the engine)
The back end is the server-side code (the engine running under the hood). It receives requests from the front end, talks to the database, runs the business logic (checking permissions, validating forms, generating PDFs), and sends responses back. It is the kitchen where the meals are prepared; the front end is just the dining table.
Database (the filing cabinet)
The database is a structured storage system (a digital filing cabinet). Every resident record, request, document metadata, and audit log is organized in tables. The database ensures that data is stored reliably, searched quickly, and never lost. Each barangay’s data lives in its own partition of this cabinet, locked away from everyone else.
File storage (the warehouse)
Uploaded documents (scanned IDs, proof of residency, supporting files) are stored in a dedicated file storage service. This keeps large binary files out of the database itself, just like storing boxes in a warehouse instead of on the front desk. Files are linked to the request record that owns them.
QR & PDF engines (the stamp and printer)
The PDF engine takes a blank .docx template and fills in the request data, producing a finished document. The QR engine then generates a unique code tied to that specific document and stamps it onto the PDF. Together, they act as the automated stamping machine and printer in the barangay office (but faster and never making a mistake).
Authentication & authorization (the bouncer)
The authentication layer is the bouncer at the front door. It verifies who you are (authentication) and checks what you are allowed to do (authorization). Residents, staff, admins, and platform admins each have a different keycard (one that opens only the doors meant for them).
Request lifecycle in detail
Every request passes through a series of statuses (like a package moving through a delivery service). Here is what each stage means:
Pending
The request has been submitted and is sitting in the staff review queue. Nobody has acted on it yet. This is the digital equivalent of a form placed in the “to review” tray on a secretary’s desk.
Pending Admin
When double approval is enabled for a document type, a staff member’s approval moves the request to this stage instead of directly to “Approved.” The request now awaits final approval from a barangay admin. This ensures a second set of eyes on sensitive documents.
Approved
The request has received all required approvals (either a single staff approval, or both staff + admin approval when double approval is enabled). The system now triggers the document generation engine to produce the PDF.
Rejected
The request has been denied (at either the staff or admin stage). The resident is notified with a reason for the rejection and can submit a corrected request.
Double approval flow
For document types that require higher accuracy (e.g., business permits, legal certifications), the barangay admin can enable double approval. When enabled, the flow changes:
- Staff reviews and approves. The staff member checks the request, fills in any required fields, and clicks “Forward to Admin.” The request moves to “Pending Admin” status.
- Admin performs final approval. A barangay admin (a different person) reviews the request again and clicks “Final Approve.” Only then is the PDF generated.
The same user cannot act as both the staff approver and the admin approver for the same request. This separation of duties prevents a single person from bypassing the dual-review requirement.
For walk-in requests created by staff, the system skips the staff approval step and sends the request directly to “Pending Admin” for admin review.
Every transition is logged
Each time a request moves from one status to the next, the system records who made the change and when. This creates a complete audit trail (a history of every action taken on that request), which is essential for accountability and transparency.
Security and access control
Security in eSerbisyo works like a building with multiple floors and multiple keycards. You can only enter the floors your keycard grants access to, and the system enforces this at every door.
Role-based access
Every user in the system is assigned a role. Each role has a clearly defined set of permissions:
- Residents can submit requests, view their own request status, and download their own documents. They cannot see anyone else’s requests or access the staff dashboard.
- Staff (encoder / secretary) can view and process requests assigned to their barangay. They can approve or reject requests and trigger document generation. They cannot modify system settings, delete records, or toggle the double-approval setting on document types.
- Barangay admins can manage staff accounts, configure document types and templates, enable double approval for sensitive document types, perform final approval on double-approval requests, and review the full audit log for their barangay. They have broader access than staff but are still scoped to their own barangay only.
- Platform admins can manage barangay registrations, licenses, and platform-wide settings. They never access individual resident records in their normal workflow.
Session management
Every login creates a session (a temporary, secure connection between the user and the system). Sessions expire after a period of inactivity, forcing the user to log in again. This prevents unauthorized access if someone walks away from a logged-in computer. Passwords are hashed (scrambled into an unreadable form) before being stored, so even a database breach would not expose plain-text passwords.
Data scoping per barangay
The most critical security guarantee is that every query is scoped to the logged-in user’s barangay. When a staff member loads the request dashboard, the system does not fetch all requests and then filter them (it asks the database only for requests belonging to that specific barangay). This means there is no code path that could accidentally return another barangay’s data. The isolation is built into the data layer itself, not bolted on afterwards.
Security at a glance
- Every user has exactly the permissions their role requires (no more, no less).
- Sessions expire automatically to prevent stale access.
- Passwords are hashed, never stored in plain text.
- Every data query is filtered by barangay at the database level.
- Every action is logged for audit and accountability.