PetWatch

A PHP MVC web app for reporting missing pets and logging sightings, extended with geolocation mapping and interactive search.

Solo project (University coursework) · PHP (MVC) · SQLite · Bootstrap/CSS · JavaScript · Leaflet + OpenStreetMap · CRUD · Authentication · Search/filtering · Geolocation + mapping
Browse pet listings with filters and actions
Browse missing pet listings with filters and quick actions.

Overview

PetWatch helps pet owners publish missing pet listings and enables the public to log sightings with location data. Owners manage listings and status updates, while authenticated users submit sightings.

The experience is built for clarity: structured listings, fast search, and map-based context for recent sightings.

  • Secure login and session-based access.
  • Owner CRUD for listings and status changes.
  • Search, filters, and pagination for browsing.
  • Sighting submissions with optional lat/lng.

The Problem

People need a simple, trustworthy way to list missing pets and record sightings with location data. Existing solutions are often fragmented, with no consistent structure or verification.

The app needed to support fast browsing while still capturing reliable details for owners to act on.

Constraints

Coursework requirements mandated a PHP MVC structure with SQLite, no frameworks or jQuery, and secure authentication. The interface needed to handle hundreds of listings efficiently.

  • Two user types with separate capabilities.
  • Session-based auth with encrypted passwords.
  • Input validation and sanitisation throughout.
  • Fast search, sorting, and pagination.
  • Geolocation mapping and AJAX endpoints.

Solution

I built a lightweight MVC application with clear model and controller boundaries. Listings and sightings are validated at input, and the browsing experience stays fast through filters and pagination.

The map view links the list and markers, centres on the user when available, and uses AJAX for smoother interactions.

Secure login + sessions

Authenticated access for posting sightings and managing listings.

Owner CRUD + status

Create, edit, delete listings with missing/found updates.

Browse + filters

Search, filter, and paginate hundreds of records.

Map-linked sightings

Geolocation and map popups tied directly to listings.

Map view of sightings with pins and list results
Sightings map with markers linked to the results list.
Report a sighting form
Report a sighting with structured fields and location data.

Architecture & Data Model

The MVC structure separates concerns across models, controllers, and views. Reusable dataset classes handle queries, pagination, and filtering without framework dependencies.

Core tables include users, pets, and sightings, with sightings storing latitude/longitude for mapping and search.

  • Users authenticate and own pet listings.
  • Pets store status and metadata.
  • Sightings reference pets with lat/lng for maps.

Security & Reliability

Authentication uses password hashing and sessions. Inputs are validated and sanitised, and output is escaped to reduce injection risk across forms and search.

  • Encrypted passwords with login/session checks.
  • Validation for listings and sightings.
  • Basic anti-injection and output escaping.

Key Screens

Create a missing pet listing
Create a missing pet listing with owner-managed details.
My listings table for the logged-in user
Logged-in view of personal listings and status updates.
Database schema diagram
Schema linking users, pets, and sightings with lat/lng.

Outcome

  • Delivered end-to-end CRUD and authentication flows.
  • Built search, filtering, and pagination for scale.
  • Integrated geolocation maps tied to real data.
  • Maintained a clean MVC structure without frameworks.