Project documentation · 05
System Documentation
Understand the portal before you put it to the test.
Technical documentation of the Barangay e-Services Portal as delivered by the original developer. Use it to understand how the system is built before you test it. ### It describes how the system works, not where it is weak.
5.1 System Overview
- Purpose: online portal for Barangay San Isidro residents to view their records, request barangay documents, read and post announcements, and upload requirements.
- Users: Residents (view own profile, request documents, post, upload) and Admins (all resident features plus the resident records list).
-
Technology stack (table):
| Layer | Technology |
|---|---|
| Web server | Apache (XAMPP) |
| Language | PHP 8 (procedural, no framework) |
| Database | MySQL / MariaDB via mysqli |
| Sessions | PHP native sessions |
| Front end | Server-rendered HTML + one CSS file |
Diagram: System architecture
Loading diagram…
5.2 Site Map and Navigation
Diagram: Site map
Loading diagram…
Features by role
| Feature | Resident | Admin |
|---|---|---|
| Log in / log out | Yes | Yes |
| Dashboard | Yes | Yes |
| My Record | Yes | - |
| Resident Records list | - | Yes |
| Request a document | Yes | Yes (sees all requests) |
| Message board | Yes | Yes |
| Upload requirements | Yes | Yes |
5.3 Database
Diagram: Entity relationship diagram
Loading diagram…
Data dictionary
residents
| Column | Type | Description |
|---|---|---|
| id | INT, PK, auto-increment | Resident ID |
| full_name | VARCHAR(100) | Full name |
| address | VARCHAR(200) | Purok and barangay |
| birthdate | DATE | Date of birth |
| contact | VARCHAR(20) | Mobile number |
| national_id | VARCHAR(255) | National ID number |
users
| Column | Type | Description |
|---|---|---|
| id | INT, PK, auto-increment | User ID |
| username | VARCHAR(50), unique | Login name |
| password | VARCHAR(255) | Account password |
| role | ENUM('admin','resident') | Access level |
| resident_id | INT, nullable | Linked resident record (NULL for admin) |
requests
| Column | Type | Description |
|---|---|---|
| id | INT, PK, auto-increment | Request ID |
| user_id | INT | Who submitted it |
| doc_type | VARCHAR(50) | Barangay Clearance, Certificate of Indigency, or Certificate of Residency |
| purpose | VARCHAR(255) | Purpose stated by the resident |
| status | VARCHAR(20) | Pending by default |
| created_at | TIMESTAMP | Date submitted |
posts
| Column | Type | Description |
|---|---|---|
| id | INT, PK, auto-increment | Post ID |
| user_id | INT | Author |
| message | TEXT | Post content |
| created_at | TIMESTAMP | Date posted |
5.4 Page Reference
| Page | Purpose | User input | Tables used |
|---|---|---|---|
index.php | Login form; starts the session | username, password (POST) | users |
dashboard.php | Welcome page and menu by role | none | residents |
record.php | Shows one resident's profile | id (URL) | residents |
residents.php | Admin list of all residents | none | residents |
request.php | Submit and list document requests | doc_type, purpose (POST) | requests, users |
board.php | Post and read community messages | message (POST) | posts, users |
upload.php | Upload and list requirement files | document (file upload) | uploads/ folder |
logout.php | Ends the session | none | none |
setup.php | Creates and resets the database with sample data | none | all |
5.5 File Structure
barangay-portal/
├── index.php Login
├── dashboard.php Dashboard
├── record.php Resident record
├── residents.php Resident list (admin)
├── request.php Document requests
├── board.php Message board
├── upload.php File uploads
├── logout.php Logout
├── setup.php Database setup / reset
├── config.php Database connection settings
├── auth.php Session start and login helpers
├── header.php Shared page header and navigation
├── footer.php Shared page footer
├── style.css Stylesheet
├── uploads/ Uploaded files
└── README_STUDENTS.md Project instructions
5.6 Request Lifecycle
- The browser sends a request to Apache, e.g.
GET /barangay-portal/record.php?id=1. - Apache runs the PHP page.
- The page loads
config.php(database connection) andauth.php(session). - If the page needs a login and there is no session, the user is redirected to
index.php. - The page reads its input, queries MySQL, and builds the HTML response.
header.phpandfooter.phpwrap the page content.
tip: Compare what this documentation says the system should do with what it actually does when you try unexpected input. Differences are where flaws hide.
Next pageTools Guide