Overview: Pet Care Service is a backend API for a pet care service and advertisement platform. The frontend in this repository is only a sample client for testing endpoints — it is not the official UI.
Note: This README is structured so that a new developer can run the project in ~5–15 minutes.
- Features
- Technologies
- Application Flow
- Requirements
- Quick Start (Docker)
- Environment Variables
- Swagger / API Documentation
- Seeding / Testing Instructions
- Roles and Authorization
- Planned Features / TODO
- User registration and login via Firebase Authentication.
- User profile: edit data and avatar.
- Manage pets — CRUD operations; pet images stored in Firebase Storage.
- Service Provider: users can become providers and post ads (ads become inactive when provider is no longer active).
- Dashboard: list cities and latest ads, filter by name and city.
- Unauthenticated users can browse ads but cannot book services.
- Archive deleted ads (can be restored).
- Additional (experimental) feature: quick “pet health check” — enter attributes/symptoms, get a health verdict (encourages service providers to accept pets).
- Full API documented using Swagger / OpenAPI.
- Next.js (API routes) + TypeScript
- PostgreSQL
- Prisma (ORM)
- Firebase Authentication + Firebase Storage
- Docker & docker-compose
- Swagger / OpenAPI
- User registers (email + password + attributes: city, first name, last name, phone). Verification email is sent via Firebase.
- Upon verification, account is created in both Firebase (auth) and database (profile).
- Login via Firebase — backend verifies JWT token.
- After login, user can:
- edit profile,
- manage pets (upload images to Firebase Storage),
- become a service provider and post ads.
- Booking (planned): client clicks
book, provides pet info and contact; service provider can accept or reject. - Admin panel (planned): view and delete users, pets, ads.
- Docker & docker-compose (recommended)
- Node.js >= 18 (if running locally)
- PostgreSQL (if not using container)
- Firebase account with Authentication and Storage configured
- Clone the repo:
git clone <REPO_URL> cd <repo-folder>
- Copy environment files:
.env.local(frontend / test variables).env(backend / services)
- Start containers:
docker compose up --build
- (Optional, clean start):
docker compose down -v && docker compose up --build
After starting:
- API available at
http://localhost:3000 - Swagger docs:
http://localhost:<3000/docs - Sample frontend:
http://localhost:3000
Example variables — fill your .env / .env.local:
DATABASE_URL=postgresql://user:password@postgres:5432/petcare?schema=public
FIREBASE_PROJECT_ID=... FIREBASE_CLIENT_EMAIL=... FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n" FIREBASE_STORAGE_BUCKET=...
All endpoints are documented via OpenAPI / Swagger. Visit /docs after server start to explore and test endpoints.
- After registration, user receives verification email (check spam folder).
- After clicking
Become service provider, re-run seed if needed to populate example ads (ads only created for service-provider role accounts). - Debug JWT button in sample frontend logs token; use
check-roleendpoint to see user roles (client,admin,service-provider).
- client — regular user, can create pet profiles, browse and book services after login.
- service-provider — can create / edit / delete ads. Ads become inactive if provider is removed.
- admin — planned, access to admin panel to view / remove users, pets, ads.