A production-ready, full-stack Pet Shop Management System with a premium UI, comprehensive admin dashboard, automated testing, containerization, and a live CI/CD pipeline.
๐ Live Demo ย |ย ๐ API Docs ย |ย ๐ณ Docker Hub
| Service | Platform | URL |
|---|---|---|
| Frontend | Vercel | pet-shop-management-system-siyam.vercel.app |
| Backend API | Render | pet-shop-backend-siyam.onrender.com |
| API Documentation | Swagger UI | /api-docs |
Demo Credentials โ Email:
admin@petshop.comยท Password:admin123
- ๐ Homepage โ Hero section, featured pets, testimonials, interactive map
- ๐ถ Browse Pets โ Species/status filters, search, paginated grid view
- ๐ Pet Inquiries โ Contact form with email notification
- โญ Customer Reviews โ Submit & view approved testimonials
- ๐ Appointment Booking โ Schedule shop visits
- ๐ฆ Order Tracking โ Real-time status via order number
- ๐ง Newsletter โ Subscribe for new-pet email alerts
- ๐ Analytics โ Live stats, revenue charts (Recharts), activity feed
- ๐ Pet Management โ Full CRUD with grid/list toggle view
- ๐ฅ Customer CRM โ Customer database with full order history
- ๐ Order Processing โ Create orders, update status, generate printable invoices
- โญ Review Moderation โ Approve, reject, or delete customer reviews
- ๐ Appointment Manager โ View and action appointment requests
- ๐ฎ Newsletter Admin โ View and manage subscriber list
- โ๏ธ Settings โ Profile, dark mode, staff account management
- ๐ Dark Mode โ Full theme support with smooth transitions
- ๐ฌ Animations โ Framer Motion page transitions & micro-interactions
- ๐ฑ Responsive โ Mobile-first, collapsible sidebar
- ๐ JWT Auth โ Role-based access control (Admin / Staff)
- ๐ง Email Notifications โ Nodemailer + Gmail SMTP
- ๐ Swagger UI โ Interactive REST API documentation at
/api-docs - ๐งช Test Suite โ 41 automated tests (Vitest + React Testing Library)
- ๐ณ Docker โ Multi-stage production builds for both services
- โ๏ธ CI/CD โ GitHub Actions runs tests on every push
| Technology | Version | Purpose |
|---|---|---|
| React | 19 | UI framework |
| Vite | 6 | Build tool & dev server |
| React Router | 7 | Client-side routing |
| Framer Motion | 12 | Animations & transitions |
| Recharts | 2 | Charts & analytics |
| Lucide React | โ | Icon library |
| React Hot Toast | โ | Toast notifications |
| Technology | Version | Purpose |
|---|---|---|
| Node.js | 20+ | JavaScript runtime |
| Express | 5 | Web framework |
| MongoDB | Atlas | NoSQL database |
| Mongoose | 8 | MongoDB ODM |
| JWT | โ | Authentication |
| bcryptjs | โ | Password hashing |
| Nodemailer | โ | Email notifications |
| Swagger UI Express | โ | API documentation |
| Tool | Purpose |
|---|---|
| Vitest | Backend & frontend test runner |
| Supertest | Backend integration testing |
| MongoDB Memory Server | In-memory DB for tests (no secrets needed) |
| React Testing Library | Frontend component testing |
| Docker + Compose | Containerization |
| GitHub Actions | CI/CD pipeline (tests + build + lint) |
| Vercel | Frontend deployment |
| Render | Backend deployment |
The project includes 41 automated tests across backend and frontend, running in CI on every push.
# Run backend tests (18 integration tests)
cd server && npm test
# Run frontend tests (23 component tests)
cd client && npm test
# Generate coverage report
npm run test:coverageBackend (supertest + MongoMemoryServer โ no real DB required):
- โ Health check endpoint
- โ Auth: login validation, wrong credentials, success, field checking
- โ Pets: public listing, filters, pagination, invalid ID (CastError โ 404)
- โ Protected routes return 401 without token (orders, customers, admin)
- โ Public routes: reviews, newsletter, inquiries
Frontend (React Testing Library + jsdom):
- โ
Buttonโ 13 tests (variants, sizes, loading, disabled, onClick, icon) - โ
Cardโ 10 tests (variants, padding, hover, className, prop forwarding)
Run the entire stack locally with a single command:
# Copy and fill in your environment file
cp .env.docker.example .env
# Start all services (MongoDB + backend + frontend)
docker compose up -d
# Seed the database
docker compose exec backend node seed.jsThen open http://localhost:3000.
# Stop all services
docker compose down| Service | Port | Description |
|---|---|---|
| MongoDB | 27017 | Database |
| Backend API | 5001 | Express server |
| Frontend | 3000 | Nginx-served React app |
GitHub Actions runs automatically on every push to main:
Push โ Tests (backend + frontend) โ Lint โ Docker Build โ Deploy (Vercel auto)
| Workflow | Description |
|---|---|
ci.yml |
Runs 41 tests + Docker build verification |
code-quality.yml |
ESLint checks |
docker-publish.yml |
Publishes Docker images on release tags |
- Node.js 18+ ยท MongoDB (local or Atlas) ยท Gmail account (for email)
# 1. Clone
git clone https://github.com/SIYAM1809/Pet-Shop-Management-System.git
cd Pet-Shop-Management-System
# 2. Install dependencies
cd server && npm install
cd ../client && npm install
# 3. Configure environment (see below)
# 4. Seed database
cd server && node seed.js
# 5. Run both services
cd server && npm run dev # Terminal 1 โ http://localhost:5001
cd client && npm run dev # Terminal 2 โ http://localhost:5173server/.env
MONGODB_URI=mongodb://localhost:27017/petshop
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRE=7d
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_EMAIL=your-email@gmail.com
SMTP_PASSWORD=your-app-password # Gmail App Password
FROM_NAME=Siyam's Praniseba
FROM_EMAIL=your-email@gmail.com
PORT=5001client/.env
VITE_API_URL=http://localhost:5001/apiGmail App Password: Google Account โ Security โ 2-Step Verification โ App Passwords
Pet-Shop-Management-System/
โโโ .github/workflows/ # CI/CD pipelines
โ โโโ ci.yml # Tests + Docker build
โ โโโ code-quality.yml # ESLint
โ โโโ docker-publish.yml # Docker Hub publishing
โ
โโโ client/ # React Frontend (Vite)
โ โโโ src/
โ โ โโโ components/ # Button, Card, Input, Modal, Sidebarโฆ
โ โ โโโ context/ # AuthContext, ThemeContext
โ โ โโโ pages/ # Admin/ + Public/ pages
โ โ โโโ services/api.js # Centralized API layer
โ โ โโโ utils/ # Animation variants
โ โโโ vitest.config.js # Frontend test config
โ โโโ Dockerfile # Multi-stage Nginx build
โ
โโโ server/ # Node.js + Express Backend
โ โโโ __tests__/api.test.js # 18 integration tests
โ โโโ config/ # DB connection + Swagger spec
โ โโโ controllers/ # Route handlers (auth, pets, ordersโฆ)
โ โโโ middleware/ # JWT auth + error handler
โ โโโ models/ # Mongoose schemas
โ โโโ routes/ # API route definitions
โ โโโ app.js # Express app factory (for testing)
โ โโโ server.js # Entry point (starts server)
โ โโโ seed.js # Admin + demo data seeder
โ โโโ vitest.config.js # Backend test config
โ โโโ Dockerfile # Multi-stage Node build
โ
โโโ docker-compose.yml # Full-stack orchestration
Full interactive documentation available at /api-docs (Swagger UI).
| Resource | Public | Admin/Staff |
|---|---|---|
GET /api/pets |
โ List + filter | โ |
POST /api/pets |
โ | โ Create |
PUT /api/pets/:id |
โ | โ Update |
DELETE /api/pets/:id |
โ | โ Delete |
GET /api/reviews |
โ Approved only | โ |
POST /api/auth/login |
โ Login | โ |
POST /api/auth/register |
โ | โ Admin only |
GET /api/orders |
โ | โ All orders |
GET /api/orders/track/:num |
โ Track by # | โ |
GET /api/dashboard |
โ | โ Analytics |
GET /api/health |
โ Health check | โ |
- JWT tokens with configurable expiry
- bcrypt password hashing (10 salt rounds)
- Role-based route protection (Admin / Staff)
- Environment variables for all secrets
- CORS configured for production origins
git checkout -b feature/your-feature
git commit -m "feat: add your feature"
git push origin feature/your-feature
# Open a Pull Request โ CI runs automaticallyMIT License โ see LICENSE for details.
Built by SIYAM1809 ยท GitHub Repo
โญ Star this repository if you find it helpful!
Made with โค๏ธ using React, Node.js, Express, and MongoDB