A comprehensive full-stack web application for managing pet hospital operations, including patient records, appointments, inventory, billing, and real-time communication.
- ๐ Secure Authentication - Register and login with OTP verification
- ๐ Pet Records Management - Add, view, and manage pet profiles
- ๐ Appointment Booking - Schedule appointments with veterinarians
- ๐ฌ Real-time Messaging - Chat with hospital staff
- ๐ค AI Chatbot - Get instant answers to common questions
- ๐ Medical History - Access complete medical records and prescriptions
- ๐ฐ Invoice Management - View and download invoices
- ๐ฅ User Management - Manage pet owners and staff accounts
- ๐ฅ Appointment Management - View and manage all appointments
- ๐ Medical Records - Create and update pet medical records
- ๐ Inventory Tracking - Monitor medicine and supplies
- ๐ Analytics Dashboard - View hospital statistics and insights
- ๐ Purchase Requests - Handle supplier orders
- ๐ณ Billing System - Generate invoices and track payments
- ๐ฎ Role-Based Access Control - Assign roles and permissions
- ๐ Security Logs - Monitor user activities
- ๐ Advanced Analytics - Chatbot analytics, user stats
- โ๏ธ System Configuration - Manage FAQs and chatbot knowledge base
- React 19.0.0 - UI library
- React Router - Client-side routing
- Axios - HTTP client
- Socket.IO Client - Real-time communication
- TailwindCSS - Styling
- Recharts - Data visualization
- React Icons - Icon library
- jsPDF - PDF generation
- React Toastify - Notifications
- Node.js - Runtime environment
- Express - Web framework
- MongoDB - Database
- Mongoose - ODM
- Socket.IO - WebSocket server
- JWT - Authentication
- bcryptjs - Password hashing
- Nodemailer - Email service
- Twilio - SMS service
- OpenAI - AI chatbot integration
- Node.js (v14 or higher)
- MongoDB (local or Atlas)
- npm or yarn
- Clone the repository
git clone https://github.com/YOUR-USERNAME/pet-hospital-system.git
cd pet-hospital-system- Install dependencies
npm run install-allOr manually:
# Root dependencies
npm install
# Backend dependencies
cd backend
npm install
# Frontend dependencies
cd ../frontend
npm install- Configure environment variables
Backend (backend/.env):
PORT=5001
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_email_app_password
FRONTEND_URL=http://localhost:3000
NODE_ENV=developmentFrontend (frontend/.env.development):
REACT_APP_API_URL=http://localhost:5001- Run the application
Option 1 - Run both servers:
npm run devOption 2 - Run separately:
# Terminal 1 - Backend
cd backend
npm start
# Terminal 2 - Frontend
cd frontend
npm start- Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
See the detailed DEPLOYMENT.md guide for step-by-step instructions to deploy to production.
- Frontend: Vercel (recommended)
- Backend: Render (recommended)
- Database: MongoDB Atlas
POST /api/auth/register - Register new user
POST /api/auth/verify-otp - Verify OTP
POST /api/auth/login - User login
GET /api/auth/me - Get current user
GET /pets - Get all pets
POST /pets - Create pet record
GET /pets/:id - Get pet by ID
PUT /pets/:id - Update pet
DELETE /pets/:id - Delete pet
GET /appointments - Get all appointments
POST /appointments - Create appointment
PUT /appointments/:nic - Update appointment
DELETE /appointments/:nic - Delete appointment
GET /medies/:petid - Get medical records by pet ID
POST /medies - Create medical record
PUT /medies/:index - Update medical record
DELETE /medies/:index - Delete medical record
- JWT-based authentication
- Password hashing with bcryptjs
- OTP verification for registration
- Role-based access control (RBAC)
- Protected routes
- CORS configuration
- Input validation
- SQL injection prevention
- XSS protection
# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm testpet-hospital-system/
โโโ backend/
โ โโโ config/ # Database config
โ โโโ controllers/ # Route controllers
โ โโโ middlewares/ # Auth & admin middlewares
โ โโโ models/ # Mongoose models
โ โโโ routes/ # API routes
โ โโโ services/ # Business logic
โ โโโ utils/ # Helper functions
โ โโโ server.js # Entry point
โโโ frontend/
โ โโโ public/ # Static files
โ โโโ src/
โ โโโ api/ # API calls
โ โโโ components/ # React components
โ โโโ context/ # Context providers
โ โโโ pages/ # Page components
โ โโโ services/ # Frontend services
โ โโโ utils/ # Helper functions
โโโ DEPLOYMENT.md # Deployment guide
โโโ README.md # This file
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Kaveesha Athukorala
- Portfolio: [Your Portfolio URL]
- LinkedIn: [Your LinkedIn URL]
- GitHub: @YOUR-USERNAME
- Email: kaveeshatech@gmail.com
- Built with React, Node.js, Express, and MongoDB
- Real-time features powered by Socket.IO
- AI chatbot integration with OpenAI
- UI components styled with TailwindCSS
- Icons from React Icons
For support, email kaveeshatech@gmail.com or create an issue in the repository.
โญ If you find this project useful, please consider giving it a star on GitHub!