Prompt
How do I build an internal request form app with approvals and audit history?
Latest observation
To build an internal request form app with approvals and audit history, think of it as 4 parts:
- Request capture
- Approval workflow
- Audit/history tracking
- Admin/reporting tools
Here’s a practical blueprint.
1) Define the workflow first
Before coding, write down:
- What kinds of requests users can submit
- Who can approve each request
- How many approval steps are needed
- What happens on reject / revise / cancel
- What must be recorded for audit
Example workflow:
- Employee submits request
- Manager reviews
- Finance or Operations approves
- System marks request as approved/rejected
- Every change is logged in history
2) Core data model
You’ll usually need these entities:
Users
- id
- name
- role
- department
Requests
- id
- requester_id
- request_type
- title
- description
- status (
draft,submitted,in_review,approved,rejected,cancelled) - current_approver_id
- created_at
- updated_at
RequestFields or RequestData
If forms are dynamic, store the submitted values as:
- request_id
- field_name
- field_value
Or as JSON in one column if your database supports it well.
Approvals
- id
- request_id
- step_number
- approver_id
- decision (
approved,rejected,returned) - comments
- decided_at
AuditLog
- id
- request_id
- actor_id
- action_type
- before_value
- after_value
- timestamp
- metadata
This audit log is important because it records:
- who changed what
- when it happened
- what the old/new values were
3) Build the app screens
At minimum, create these pages:
User side
- Login
- New request form
- My requests
- Request detail page
- Approval history/timeline
Approver side
- Approval inbox
- Request review page
- Approve / Reject / Return for edits
Admin side
- Manage request types
- Manage approval rules
- View audit logs
- Reports/export
4) Implement workflow logic
Use a state machine or workflow engine pattern.
Basic status transitions
draft→submittedsubmitted→in_reviewin_review→approvedin_review→rejectedrejected→draftorsubmittedif resubmittedsubmitted/in_review→cancelled
Approval rules
Examples:
- If request amount < $500, only manager approval needed
- If request amount >= $500, manager + finance approval needed
- If department = IT, route to IT lead
This logic can live in:
- code
- configuration tables
- a workflow engine
For most internal apps, configuration tables + business logic in backend is enough.
5) Audit history design
A good audit trail should be append-only.
Do not overwrite history. Instead, write a log row for every important event:
- request created
- field edited
- submitted
- approval approved/rejected
- comment added
- status changed
- attachment uploaded/deleted
Audit log example
{
"request_id": 123,
"actor_id": 45,
"action_type": "status_changed",
"before_value": "submitted",
"after_value": "in_review",
"timestamp": "2026-10-24T10:30:00Z"
}
If you need stronger compliance, also store:
- IP address
- user agent
- session ID
- approval reason
- digital signature or e-sign acceptance
6) Security and permissions
This is critical for internal approvals.
Role-based access control
- Requester: create/edit own draft requests, view own requests
- Approver: view requests assigned to them, approve/reject
- Admin: manage workflows and all records
- Auditor: read-only access to logs
Important rules
- Users should only see requests they’re allowed to see
- Approvers should not approve requests outside their scope
- Audit logs should be immutable or heavily restricted
- Use strong authentication, ideally SSO
7) Suggested tech stack
Simple and fast to build
- Frontend: React, Next.js, Vue, or Angular
- Backend: Node.js, Django, Rails, or .NET
- Database: PostgreSQL
- Auth: SSO/OAuth/SAML if in a company environment
- File storage: S3 or equivalent
- Email/notifications: SendGrid, SES, or internal mail
If you want low-code
- Power Apps + Power Automate
- Retool + Postgres
- AppSheet
- Airtable with approval automation
This is often the fastest route for internal tools.
8) Notifications and reminders
Add:
- email notifications on submission
- Slack/Teams messages
- reminders for pending approvals
- escalation if SLA is missed
Example:
- Notify approver when request is assigned
- Remind after 2 business days
- Escalate to backup approver after 5 days
9) Reporting and admin tools
Useful reports:
- number of requests by type
- average approval time
- pending approvals by user
- rejected request reasons
- audit activity by date
Add filters:
- date range
- department
- request type
- status
- approver
10) Build it incrementally
A good MVP order:
Phase 1
- User login
- Request form
- Submit request
- Approver inbox
- Approve/reject
- Basic audit log
Phase 2
- Multi-step approvals
- Comments
- Notifications
- Request templates
Phase 3
- Role management
- Reporting dashboards
- Attachments
- SLA/escalation
- Export/audit compliance features
11) Example implementation approach
If using a conventional web app:
Backend endpoints
POST /requestsGET /requests/mineGET /requests/:idPOST /requests/:id/submitPOST /requests/:id/approvePOST /requests/:id/rejectGET /requests/:id/audit
On every action:
- validate permissions
- update request status/data
- write approval record if needed
- write audit log entry
- send notification
12) Things people often forget
- Prevent editing after submission unless returned
- Record timestamps in UTC
- Keep approval history separate from request data
- Handle concurrency so two approvers don’t act at once
- Support attachments and versioning if forms change
- Make audit logs tamper-resistant
13) Recommended architecture pattern
A solid internal app architecture:
- UI layer for forms and approvals
- API layer for business logic
- Workflow service for routing and status changes
- Audit service for immutable history
- Notification service for email/chat alerts
- Database for requests, approvals, logs
If you want, I can also give you one of these next:
- a database schema
- a React + Node.js starter architecture
- a low-code/Power Apps version
- a full sample workflow with tables and API endpoints