A comprehensive Spring Boot application for pet management services, including e-commerce functionality, appointment scheduling, user management, and notification services.
Petify is a full-featured backend service designed to support pet care businesses. It provides a robust platform for managing pets, scheduling appointments with service providers, handling e-commerce transactions, and maintaining user profiles. The application features secure authentication, payment processing integration, and a complete administrative system.
- Authentication & Authorization: JWT-based secure authentication with role-based access control
- Pet Management: Complete pet profile management with medical records and care history
- Service Provider System: Appointment scheduling and service provider management
- E-commerce Platform: Product catalog, shopping cart, and order management
- Payment Processing: Integrated payment gateway with webhook support
- Notification System: Real-time notifications for users and service providers
- User Management: Comprehensive user profiles with role-based permissions
- File Storage: Secure file upload and storage for profile pictures and documents
- RESTful API: Well-structured REST endpoints with comprehensive validation
- Database Integration: MySQL database with JPA/Hibernate ORM
- Security: Spring Security with JWT token authentication
- Email Services: SMTP email integration for notifications
- API Documentation: Swagger/OpenAPI documentation
- Error Handling: Global exception handling with custom error responses
- Validation: Comprehensive input validation and sanitization
- Containerization: Docker support for easy deployment
- Framework: Spring Boot 3.5.5
- Language: Java 24
- Database: MySQL 8.0
- Authentication: JWT (JSON Web Tokens)
- Security: Spring Security
- ORM: Spring Data JPA / Hibernate
- Documentation: SpringDoc OpenAPI (Swagger)
- Email: Spring Mail with SMTP
- Build Tool: Maven
- Containerization: Docker & Docker Compose
- Docker & Docker Compose
- Git
Important: Before running the application, you must create a .env file in the root directory with the following variables:
# Server Configuration
SERVER_PORT=8080
# JWT Configuration
JWT_SECRET=your_jwt_secret_key
# Email Configuration
EMAIL=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
# Payment Gateway (Paymob)
PAYMOB_HMAC_KEY=your_paymob_hmac_key
PAYMOB_API_KEY=your_paymob_api_key
PAYMOB_SECRET_KEY=your_paymob_secret_key
PAYMOB_PUBLIC_KEY=your_paymob_public_key
PAYMOB_INTEGRATION_ID=your_integration_id
WEBHOOK_URL=your_webhook_urlNote: Database credentials are configured in docker-compose.yml (user: root, password: rootpass, database: petify). If you need to change them, edit the docker-compose.yml file directly.
-
Clone the repository
git clone https://github.com/EgronX-Petify/Backend cd Backend -
Create the .env file with the variables shown above
-
Start the application
docker compose up --build
-
Access the application
- API Base URL:
http://localhost:8080 - MySQL Database:
localhost:3306
- API Base URL:
Once the application is running, you can access the interactive API documentation via Swagger UI:
Swagger UI: http://localhost:8080/swagger-ui/index.html
The Swagger documentation provides:
- Complete API endpoint reference
- Request/response schemas
- Interactive testing interface
- Authentication examples
- Error response codes
com.example.petify/
├── config/ # Configuration classes
├── controller/ # REST controllers
├── dto/ # Data Transfer Objects
├── model/ # JPA Entities
├── repository/ # Data repositories
├── service/ # Business logic services
├── mapper/ # Entity-DTO mappers
├── exception/ # Custom exceptions
├── utils/ # Utility classes
├── validation/ # Custom validators
├── specification/ # Specifications
└── runner/ # Application runners
The application uses MySQL as the primary database. The database schema is automatically created and updated using Hibernate's DDL auto-update feature.
- JWT token-based authentication
- Role-based access control (Admin, Pet Owner, Service Provider)
- Password encryption using BCrypt
- CORS configuration for frontend integration
- Images are stored in the
uploads/directory - Secure file upload with validation
- Support for various image formats
The application includes Spring Boot Actuator for comprehensive monitoring and management:
- Access: All actuator endpoints are restricted to users with ADMIN role only
- Base Path:
/actuator - Available Endpoints:
/actuator/health- Application health status/actuator/info- Application information/actuator/metrics- Application metrics/actuator/env- Environment properties- And more...
Note: You must authenticate with admin credentials to access any actuator endpoint. Non-admin users will receive a 403 Forbidden response.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is proprietary software. All rights reserved.
For support and questions, please contact the development team or create an issue in the repository.