PawPal is a full-stack web application designed to streamline the pet adoption process. It provides a centralized, user-friendly platform that directly connects individuals looking to rehome their pets with potential adopters, fostering responsible and efficient pet transitions.
This project was developed as a final year B.Tech project in Computer Science and Engineering.
- User Authentication: Secure registration with email verification and login using JWT-based sessions.
- Pet Listings (CRUD): Users can create, view, edit, and delete detailed pet profiles, including image uploads.
- Public Pet Browsing: A paginated, public gallery of all available pets for anyone to browse.
- Adoption Request Workflow: A complete lifecycle for adoption requests:
- Adopters can submit requests with a personal message.
- Listers can view and manage received requests.
- Both parties can approve, reject, or withdraw requests.
- Asynchronous Notification System:
- In-App Notifications: Real-time (or polled) alerts for key events via a notification bell.
- Email Notifications: Robust, asynchronous email sending for critical updates (new requests, status changes) using BullMQ and Redis to ensure a non-blocking user experience.
- File Uploads: Pet image uploads are handled using
multerand stored on the server's filesystem. - Responsive UI: A modern and responsive user interface built with Tailwind CSS and Shadcn UI.
This project leverages a modern, type-safe technology stack for a robust and maintainable application.
| Area | Technologies |
|---|---|
| Frontend | React, Vite, TypeScript, Recoil, Tailwind CSS, Shadcn UI, Axios, React Router, date-fns |
| Backend | Node.js, Express.js, TypeScript, Prisma ORM, JWT, bcrypt, Zod, Multer |
| Database | PostgreSQL |
| Asynchronous Tasks | BullMQ (Job Queue), Redis (Queue Backend), Nodemailer (Email Sending) |
| DevOps | Docker, Docker Compose, Nginx (optional), GitHub Actions (for CI/CD) |
The application follows a multi-tier architecture to ensure separation of concerns and scalability.
- Client (Browser): The React single-page application that users interact with.
- Web Server (Backend): The Node.js/Express.js server that handles API requests, business logic, and user authentication.
- Database Server: PostgreSQL database managed by Prisma ORM for data persistence.
- Queue & Worker System: Redis and BullMQ manage a queue of background jobs (like sending emails), which are processed by a separate worker service to avoid blocking the main API.
To get a local copy up and running, follow these steps.
- Node.js (v18.x or later recommended)
- npm or yarn
- PostgreSQL
- Redis
- Docker & Docker Compose (Recommended)
- Clone the repository:
git clone https://github.com/yourusername/pawpal.git cd pawpal - Backend Setup:
cd server npm install # Create a .env file based on .env.example and fill in your DB, Redis, JWT, and SMTP credentials. cp .env.example .env # Run Prisma migrations to set up the database schema npx prisma generate && npx prisma migrate dev # Start the backend server npm run dev
- Frontend Setup:
cd ../frontend # Or your frontend directory name npm install # Create a .env file and set VITE_API_BASE_URL to your backend URL (e.g., http://localhost:3001/api) cp .env.example .env # Start the frontend dev server npm run dev
Using Docker is the recommended way to run the entire stack consistently.
- Clone the repository:
git clone https://github.com/Versatile-Programmer/pawpal.git cd pawpal - Setup Environment Variables:
- Create a
.envfile in therootdirectory with name.env. - Create a .env file based on .env.example and fill in your DB, Redis, JWT, and SMTP credentials.
- Create a
POSTGRES_DB=pawpaldb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=mypassword
BACKEND_PORT=5005
FRONTEND_PORT=5173
SMTP_HOST=your_SMTP_HOST
SMTP_USER=YOUR_SMTP_USER
SMTP_PASSWORD=YOUR_SMTP_PASSWORD
FROM_EMAIL=YOUR_FROM_EMAIL_TO_SEND_ALL_EMAIL
REDIS_HOST=redis
SECRET_KEY=YOUR_JWT_SECRET_KEY- Build and Run:
docker-compose up --build -d
- After running this command a container will start in your docker.
The frontend will be available at http://localhost:5173 and the backend at http://localhost:5005.
- The open-source community for the amazing tools and libraries used.
