Live Demo · Setup Guide · API Docs
If this project helps you, please consider giving it a star ⭐ — it helps others find it too.
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.
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- Node.js (v14 or higher)
- MongoDB
- Python 3.8+ (for analytics)
- npm or yarn
# 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# Navigate to the frontend directory
cd site
# Install frontend dependencies
npm install
# Start the development server
npm run devThere are multiple ways to start the application:
# 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# 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# In a separate terminal, navigate to the site directory
cd site
# Start the Next.js frontend
npm run devFor 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.
The API provides the following endpoints:
POST /api/auth/register- Register a new userPOST /api/auth/login- Login a userGET /api/auth/me- Get current userGET /api/auth/google- Google OAuth login
GET /api/pets- Get all pets (with filtering)GET /api/pets/:id- Get a single petPOST /api/pets- Add a new petPUT /api/pets/:id- Update a petDELETE /api/pets/:id- Delete a pet
GET /api/appointments- Get all appointmentsGET /api/appointments/:id- Get a single appointmentPOST /api/appointments- Create an appointmentPUT /api/appointments/:id- Update an appointmentDELETE /api/appointments/:id- Delete an appointmentGET /api/appointments/branch/:branchName- Get branch appointmentsGET /api/appointments/public/clear- Clear all appointments (testing)GET /api/appointments/public/setup- Generate sample appointments (testing)
GET /api/analytics/branch- Get branch analytics and predictionsGET /api/analytics/pet-type-predictions- Get AI-powered pet type predictions
- Customer: Browse pets, book appointments, view own appointments
- Employee: Manage appointments, view branch data
- Admin: Full access to all features including analytics, employee management
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
- 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