Skip to content
SakithaSamarathunga33Public

About

AI-powered pet care management system for browsing pets, booking appointments, and forecasting demand with Facebook Prophet

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

57 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐾 Pet Care Management System


Live Demo · Setup Guide · API Docs

If this project helps you, please consider giving it a star ⭐ — it helps others find it too.

Pet Care Banner

📋 Overview

A comprehensive pet care management system that connects pet owners with pet shops and services. This application helps users browse available pets, book appointments, manage their pet ownership journey, and allows administrators to manage inventory, appointments, and analytics. The newest version includes advanced AI-powered predictions for appointment trends.

✨ Features

🐕 For Customers

  • Pet Browsing: Browse available pets by type, gender, and price range
  • Appointment Booking: Schedule appointments to meet pets or get services
  • User Profiles: Manage personal information and view appointment history
  • Responsive Design: Fully responsive interface for mobile and desktop

👨‍💼 For Administrators

  • Pet Management: Add, edit, and manage pet listings with default images for each type
  • Appointment Tracking: View, update, and manage all customer appointments
  • Branch Management: Track activities across multiple branches
  • Employee Management: Manage employee records and assignments
  • Advanced Analytics: Visualize sales, appointments, and popular pet types with AI predictions
  • Time Series Forecasting: AI-powered predictions of future appointment trends by branch and pet type

🧠 AI Prediction System

Features

  • Time Series Forecasting: Uses Facebook Prophet to predict future appointment trends
  • Segmented Analysis: Individual predictions for each branch and pet type combination
  • Intelligent Caching: Stores predictions for faster retrieval in future sessions
  • Fallback Mechanism: Provides estimated predictions if real-time predictions are unavailable
  • Visualization: Interactive charts showing predicted appointment distribution by pet type and branch

Implementation Details

  • Separate Models: Individual prediction models for each branch/pet type combination
  • Parallel Processing: Concurrent prediction generation for improved performance
  • Python Backend: Python scripts for data processing and prediction generation
  • MongoDB Integration: Stores and retrieves historical data and predictions
  • Asynchronous Loading: Frontend handles loading states with adaptive timeouts

🛠️ Technologies

Frontend

  • Next.js: React framework for server-side rendering and static site generation
  • Tailwind CSS: Utility-first CSS framework for rapid UI development
  • Framer Motion: Animation library for React
  • React Icons: Icon library for React applications
  • Chart.js: JavaScript charting library for analytics visualizations

Backend

  • Node.js: JavaScript runtime for building server-side applications
  • Express: Web application framework for Node.js
  • MongoDB: NoSQL database for storing application data
  • Mongoose: MongoDB object modeling for Node.js
  • JWT: JSON Web Tokens for authentication
  • Passport.js: Authentication middleware for Node.js

AI & Analytics

  • Python: Programming language for data analysis and machine learning
  • Facebook Prophet: Time series forecasting library for predictive analytics
  • NumPy/Pandas: Data manipulation and analysis libraries
  • MongoDB Aggregation: Advanced data processing for analytics

🚀 Installation & Setup

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • Python 3.8+ (for analytics)
  • npm or yarn

Backend Setup

# Clone the repository
git clone (https://github.com/SakithaSamarathunga33/THE-PET.git)

# Install backend dependencies
cd server
npm install

# Install Python dependencies for analytics
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your MongoDB connection string and JWT secret

# Start the server
npm run dev

Frontend Setup

# Navigate to the frontend directory
cd site

# Install frontend dependencies
npm install

# Start the development server
npm run dev

Running the Application

There are multiple ways to start the application:

Option 1: Starting the Server with Python Environment

# Navigate to the server directory
cd server

# Run the start script (activates Python venv and starts server)
.\start-with-venv.bat

# This script activates the Python virtual environment and starts the Node.js server

Option 2: Starting the Server Manually

# Navigate to the server directory
cd server

# Activate the Python virtual environment
venv\Scripts\activate.bat  # Windows
# OR
source venv/bin/activate  # Mac/Linux

# Start the server
npm run dev

Option 3: Starting the Frontend

# In a separate terminal, navigate to the site directory
cd site

# Start the Next.js frontend
npm run dev

For the complete application, you need to run both the server (Option 1 or 2) and the frontend (Option 3) in separate terminal windows.

Visit http://localhost:3000 to use the application with the frontend. API endpoints will be available at http://localhost:8080.

📊 API Endpoints

The API provides the following endpoints:

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Login a user
  • GET /api/auth/me - Get current user
  • GET /api/auth/google - Google OAuth login

Pets

  • GET /api/pets - Get all pets (with filtering)
  • GET /api/pets/:id - Get a single pet
  • POST /api/pets - Add a new pet
  • PUT /api/pets/:id - Update a pet
  • DELETE /api/pets/:id - Delete a pet

Appointments

  • GET /api/appointments - Get all appointments
  • GET /api/appointments/:id - Get a single appointment
  • POST /api/appointments - Create an appointment
  • PUT /api/appointments/:id - Update an appointment
  • DELETE /api/appointments/:id - Delete an appointment
  • GET /api/appointments/branch/:branchName - Get branch appointments
  • GET /api/appointments/public/clear - Clear all appointments (testing)
  • GET /api/appointments/public/setup - Generate sample appointments (testing)

Analytics

  • GET /api/analytics/branch - Get branch analytics and predictions
  • GET /api/analytics/pet-type-predictions - Get AI-powered pet type predictions

👥 User Roles

  • Customer: Browse pets, book appointments, view own appointments
  • Employee: Manage appointments, view branch data
  • Admin: Full access to all features including analytics, employee management

🔒 Authentication

The application uses JWT (JSON Web Tokens) for authentication and supports:

  • Traditional email/password login
  • Google OAuth login (for customer accounts)
  • Role-based access control for protected routes

🔮 Future Features

  • Pet Health Records: Track pet vaccinations and medical history
  • E-commerce Integration: Purchase pet supplies online
  • Pet Adoption Process: Streamline the pet adoption paperwork
  • Push Notifications: Send reminders for appointments
  • Social Sharing: Share pet listings on social media
  • Enhanced AI Analytics: Deeper insights into seasonal trends and customer behaviors

Made with ❤️ for pets and their owners

About

AI-powered pet care management system for browsing pets, booking appointments, and forecasting demand with Facebook Prophet

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages