In many countries, stray animals and cases of animal abuse are common and often go unaddressed. Pawtner is a web-based platform designed to allow users to report animal abuse and lost/found pets efficiently. The platform integrates Google Maps API to enable precise location reporting and Firebase for authentication and data management.
Live demo: https://pawtnerfront.onrender.com
-
Report Animal Abuse
- Users can report cases of animal abuse with details like location, description, and images.
- The reports appear on an interactive map for community awareness.
-
Report Lost and Found Animals
- Users can report lost or found animals, helping to reunite pets with their owners.
- Reports include images, breed, and last known location.
-
View Reports on an Interactive Map
- Users can see all reports plotted on Google Maps.
- Clicking on a marker opens a detailed view with an expandable info window.
-
Modern UI with React
- Fully responsive and optimized for a seamless user experience.
- Dark mode support
-
Update the report
- Users can update their reports
- Frontend: React, Vite, CSS
- Backend: Node.js, Express.js, Firebase Firestore
- Authentication: Firebase Authentication
- Database: Firebase Firestore
- Maps API: Google Maps JavaScript API (@vis.gl/react-google-maps)
- State Management: React Hooks (
useState,useEffect) - Deployment: Render
- Development Tools: Postman, VS Code, Git/GitHub
The frontend is built with React and uses @vis.gl/react-google-maps for map integration.
Google Maps Integration
import { APIProvider, Map, Marker } from "@vis.gl/react-google-maps";
export default function ReportMap({ updateLocationOnForm }) {
const handleMapClick = (event) => {
if (event.detail) {
const { lat, lng } = event.detail.latLng;
updateLocationOnForm(lat, lng);
}
};
return (
<div className="map-container">
<APIProvider apiKey={import.meta.env.VITE_ANIMALMAP}>
<Map
defaultCenter={{ lat: 49.282729, lng: -123.120738 }}
defaultZoom={12}
onClick={handleMapClick}
disableDefaultUI={true}
/>
</APIProvider>
</div>
);
}Interactive Report Cards with Expandable Info
import { useState } from "react";
export default function ReportCard({ report }) {
const [expanded, setExpanded] = useState(false);
return (
<div className={`report-card ${expanded ? "expanded" : ""}`}>
<img src={report.imageUrl} alt="Animal" />
<p><strong>Type:</strong> {report.type}</p>
<p><strong>Date:</strong> {report.date}</p>
{expanded && (
<>
<p><strong>Animal:</strong> {report.animal}</p>
<p><strong>Description:</strong> {report.description}</p>
</>
)}
<button onClick={() => setExpanded(!expanded)}>
{expanded ? "Show Less" : "More Info"}
</button>
</div>
);
}The backend is built with Node.js + Express.js and connects to Firebase Firestore for data storage.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /reports | Creates a new report, allowing image uploads. Requires authentication (token) |
| GET | /reports | Retrieves all reports stored in Firebase Firestore |
| DELETE | /reports/:id | Deletes a specific report by ID. |
| PUT | /reports/:id | Edit the report information |
| Action | Description |
|---|---|
| Create | Add a new report when a user submits one, allowing image uploads |
| Read | Retrieve all reports to display on the map or in a list |
| Delete | Remove a report by ID (only for authenticated users) |
| Update | Update the report |
To run the Pawtner: Pet Support Platform, follow these setup steps:
- Prerequisites
- You must have a Firebase project configured with the following services enabled:
- Storage (for image uploads)
- Authentication (for user login and report ownership tracking)
- Firestore Database (to store reports)
✅ Google Maps API must be enabled in your Google Cloud Console to use location services.
✅ Install Node.js and npm before proceeding.
- Project Setup
For both the frontend and backend, install dependencies by running:
npm install
- Database Configuration
Pawtner stores reports in Firebase Firestore. The database should be structured as follows:
/reports
├── {reportId}
│ ├── type: "lost" | "found" | "abuse"
│ ├── animal: "Dog"
│ ├── breed: "Beagle"
│ ├── date: "YYYY-MM-DD"
│ ├── email: "user@example.com"
│ ├── location: { lat: 49.2827, lng: -123.1207 }
│ ├── imageUrl: "https://storage.googleapis.com/bucket-name/uploads/animal.jpg"
│ ├── user_id: "firebase_user_id"
- Frontend Setup
✅ Steps to Start the Frontend:
- Ensure that Google Maps API is enabled in Google Cloud Console.
- Run the following command to start the development server:
npm run dev- Backend Setup
✅ Steps to Start the Backend:
- Generate a Firebase Service Account JSON file, download it, and place it in the project root directory.
- Run the following command to initialize the backend server:
npm run init- Geolocation:
o Allow users to select or view the location of a report (abuse, lost/found animal) on the map. o Display markers on the map for registered reports.
- The user selects a location on the map.
- The frontend captures the latitude and longitude from the map click event and updates the form fields.
- When the user submits a report, the form data (including coordinates and image) is sent to the backend.
- When an image is uploaded, the backend stores it in Firebase Storage and generates a public image URL.
- The backend stores the report in Firestore, linking it with the image URL and the user ID (if authenticated).
- The frontend retrieves all reports from the backend, including their coordinates and images.
- The reports are displayed as markers on the Google Map, allowing users to click and view details inside an expandable InfoWindow.
The Pawtner platform follows a three-tier architecture:
- The Frontend (React) handles user interactions.
- The Backend (Node.js + Express) manages API requests and connects to the database.
- The Database (Firebase Firestore) stores reports, user data, and image URLs.
Below is an interactive diagram representing the data flow:
graph TD;
User -->|Interacts with| Frontend(React);
Frontend -->|API Requests| Backend(Node.js);
Backend -->|Stores & Retrieves Data| Database(Firebase);
Backend -->|Google Maps Integration| GoogleMaps;
This page contains a catchy phrase and below it a summary of the project's purpose.
On this page, if the user is authenticated, a map will be shown where the user will select a place and then fill in the report information.
Below the form to submit a report there will also be a button to return to the map in case the user selected the wrong place.
If the user is not authenticated, the reports page will appear like this:
The view page can be accessed even by unauthenticated users, it will contain the map with the corresponding pins on it and when clicked it will show the reports made in that place.
If the user is authenticated, he will be able to see his reports already made below and can delete them if he wants.
If the authenticated user has not yet made any reports, the page display will be like this
On this page the user can log in if they already have an account.
On this page the user will create their account











