A comprehensive web-based lost cat tracking system with real-time map integration, built with PHP, MySQL, and Leaflet.js.
- User Registration & Authentication: Secure user accounts with password hashing
- Cat Profile Management: Register multiple cats with photos and detailed information
- Lost Cat Reporting: Report lost cats with location pinning on interactive maps
- Real-Time Map Visualization: See all lost cats on an interactive map using OpenStreetMap
- Location-Based Alerts: Users see lost cats within 50km of their location
- Mark Found: Update lost reports when cats are reunited
- Community Sightings: (Database ready - can be extended)
- Responsive design with warm, compassionate aesthetics
- Interactive maps with Leaflet.js and OpenStreetMap
- Marker clustering for better map performance
- Geocoding support (address to coordinates)
- Distance calculation using Haversine formula
- Secure file uploads for cat photos
- Location-based search and filtering
- Web Server: Apache 2.4+ or Nginx
- PHP: 7.4 or higher
- MySQL: 5.7+ or MariaDB 10.3+
- PHP Extensions:
- mysqli
- gd (for image handling)
- fileinfo
- session
- Create a new MySQL database:
CREATE DATABASE lost_cat_tracker;- Import the database schema:
mysql -u root -p lost_cat_tracker < database.sqlOr manually execute the SQL file in phpMyAdmin or MySQL Workbench.
Edit includes/config.php and update the database credentials:
define('DB_HOST', 'localhost');
define('DB_USER', 'your_username');
define('DB_PASS', 'your_password');
define('DB_NAME', 'lost_cat_tracker');Ensure the uploads directory is writable:
chmod 755 uploads/
chmod 755 uploads/cats/Create a .htaccess file in the root directory:
RewriteEngine On
RewriteBase /
# Protect sensitive files
<FilesMatch "^(config|database)\.">
Order allow,deny
Deny from all
</FilesMatch>
# Enable PHP file uploads
php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value max_execution_time 300- Open your web browser
- Navigate to
http://localhost/lost-cat-tracker(or your configured domain) - Default admin credentials (if using the sample data):
- Username:
admin - Password:
admin123
- Username:
lost-cat-tracker/
βββ css/
β βββ style.css # Main stylesheet with distinctive design
βββ includes/
β βββ config.php # Database configuration and helper functions
βββ uploads/
β βββ cats/ # Cat photos storage
βββ database.sql # Database schema
βββ index.php # Homepage with map and listings
βββ register.php # User registration
βββ login.php # User login
βββ logout.php # Logout handler
βββ dashboard.php # User dashboard
βββ my-cats.php # Cat profile management
βββ report-lost.php # Report lost cat
βββ cat-details.php # Lost cat details page
βββ mark-found.php # Mark cat as found
βββ map.php # Full-screen map view
βββ README.md # This file
- Fonts:
- Display: DM Serif Display (warm, friendly serif)
- Body: Manrope (modern, readable sans-serif)
- Color Palette:
- Primary:
#FF6B35(Warm Orange) - Secondary:
#4ECDC4(Turquoise) - Accent:
#FFE66D(Yellow) - Background:
#FFF8F0(Cream)
- Primary:
- Smooth animations and transitions
- Hover effects on cards and buttons
- Animated navigation underlines
- Floating hero elements
- Responsive design for mobile devices
-
Register an Account
- Click "Sign Up" and fill in your details
- Pin your location on the map
- This helps you see lost cats near you
-
Add Your Cats
- Go to "My Cats" β "Add New Cat"
- Upload a photo and fill in details
- Include distinctive features for identification
-
Report a Lost Cat
- Click "Report Lost" from dashboard
- Select the cat from your registered cats
- Pin the location where last seen
- Add any additional information
-
Mark as Found
- When your cat is found, go to the report
- Click "Mark as Found"
- This removes it from the active lost cats map
-
View Lost Cats
- Browse the homepage to see recent lost cats
- Use the map to see cats near your location
- Click on markers for detailed information
-
Help Find Lost Cats
- Contact owners if you spot a lost cat
- Use the phone number or email provided
- Provide specific location and time information
- Marker Types:
- Red Cat Icon: Lost cats
- Blue Pin Icon: User location
- Teal Circles: Community sightings
- Automatically groups nearby markers
- Click clusters to zoom in
- Shows individual cats when zoomed
- Convert addresses to coordinates
- Automatic location detection in browsers
- Manual map pinning support
- Password hashing with bcrypt (PHP password_hash)
- SQL injection prevention with prepared statements
- XSS protection with htmlspecialchars
- CSRF protection ready
- File upload validation and sanitization
- Session-based authentication
users
- User accounts and profile information
- Location coordinates for nearby cat alerts
cats
- Cat profiles with photos and details
- Linked to user accounts
lost_reports
- Lost cat reports with location and status
- Tracks lost date and found date
- Contact information for reporting
sightings (optional)
- Community sightings of lost cats
- Extends functionality for community reporting
Edit css/style.css CSS variables:
:root {
--primary: #FF6B35;
--secondary: #4ECDC4;
--accent: #FFE66D;
/* ... */
}Change the proximity radius in includes/config.php:
function getLostCatsNearLocation($lat, $lon, $radius = 5) {
// Change $radius default value (in kilometers)
}- OpenStreetMap for map tiles
- Leaflet.js for map functionality
- Google Fonts for typography
- Inspired by the need to help reunite lost cats with their families
Made with β€οΈ for cats and their loving owners
πΎ Help bring lost cats home! πΎ