A full-stack pet adoption platform where users can browse, list, and adopt pets.
Snuggle is a pet adoption platform built with Next.js and Express.js. Users can browse available pets, apply for adoption with eKYC identity verification, sign digital adoption contracts, chat with shelters in real time, and manage their profiles. The platform uses Firebase for authentication and Firestore for data storage.
For tech stack and folder structure, see SPEC.md.
- Node.js 18+
- Yarn
- Firebase project
# Install frontend dependencies
cd frontend
yarn install
# Install backend dependencies
cd ../backend
yarn install
# Setup Git hooks (optional)
cd backend
yarn prepareCreate a Firebase project at console.firebase.google.com:
- Enable Authentication (Email/Password provider)
- Enable Firestore Database
- Create a service account and download the private key
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
NEXT_PUBLIC_API_URL=http://localhost:3001/apiFIREBASE_API_KEY=your-firebase-key
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_SERVICE_ACCOUNT_FILE=./firebase-service-key.json
PORT=3001
NODE_ENV=development
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=[email protected]
SMTP_PASS=your-app-password
SMTP_FROM=Snuggles [email protected]Note: Create a service account in Firebase Console and download the JSON key. Place it in the
backend/directory and rename it tofirebase-service-key.json(or update the path inFIREBASE_SERVICE_ACCOUNT_FILE).
See SPEC.md for detailed system specifications, database schema, and feature documentation.
# Terminal 1 - Backend
cd backend
yarn dev
# Terminal 2 - Frontend
cd frontend
yarn dev- Frontend: http://localhost:3000
- Backend: http://localhost:3001
# Frontend
cd frontend
yarn lint # ESLint (zero warnings allowed)
yarn format # Prettier
# Backend
cd ../backend
yarn lint # ESLint on src/
yarn format # PrettierFirebase is fully mocked — no real Firebase project needed for tests.
# Frontend
cd frontend
yarn test # Vitest
yarn test -- file.test # Single test file
# Backend
cd ../backend
yarn test # Jest (30s timeout)
yarn test -- file.test # Single test file
yarn test:watch # Watch mode
yarn test:coverage # With coverageSee SPEC.md for full API documentation including request/response examples and error codes.
# Build frontend
cd frontend
yarn build
# Build backend
cd ../backend
yarn build
yarn startMIT