How everlynewilly/finalproject works
This is a pet-adoption web application with a React client and PHP/MySQL API. The main adopter journey is browsing pets, viewing a pet, submitting screening information, then completing payment after approval; administrators manage pets, users, and screening decisions. The sampled code confirms routing, API-service calls, screening persistence, and payment-callback effects. Payment initiation and several client screens are not sampled, so links through those stages are shown only where supported by the file tree or explicit code.
Main entry points: App.jsx App routing · api.js API service · admin.jsx Admin dashboard · screening Screening endpoints
Components 21
React client
- App routing
pet-project-react/src/App.jsx - Auth context
pet-project-react/src/context/AuthContext.jsx - Admin dashboard
pet-project-react/src/components/admin.jsx - API service
pet-project-react/src/services/api.js
Adoption workflow
- Pet browsing
pet-project-react/src/components/petlist.jsx - Pet details
pet-project-react/src/components/petdetails.jsx - Screening form
pet-project-react/src/components/screening.jsx - Payment screen
pet-project-react/src/components/payment.jsx - Adoption outcome
pet-project-react/src/components/adoption-success.jsx
PHP API
- Authentication API
petprojectt/api/auth - Pet endpoints
petprojectt/api/pets - Screening endpoints
petprojectt/api/screening - Adoption decisions
petprojectt/adoption_requests - Payment endpoints
petprojectt/api/payment - Payment callback
petprojectt/payments/payment_callback.php - MySQL database
petprojectt/config/db.php
External services
- Email sender
petprojectt/config/mailer.php - M-Pesa
petprojectt/config/mpesa.php - SMTP server
Other components
- Adopter
- Administrator
Connections 24
- Adopter → App routing: uses
- Administrator → App routing: uses
- App routing → Auth context: provides session
- App routing → Pet browsing: routes to
- App routing → Pet details: routes to
- App routing → Screening form: routes to
- App routing → Payment screen: routes to
- App routing → Adoption outcome: routes to
- App routing → Admin dashboard: protects route
- Pet browsing → API service: loads pets
- Pet details → API service: loads pet
- Screening form → API service: submits form
- Admin dashboard → API service: manages records
- API service → Authentication API: requests auth
- API service → Pet endpoints: requests pets
- API service → Screening endpoints: requests screening
- API service → Payment endpoints: initiates payment
- Screening endpoints → MySQL database: writes requests
- Screening endpoints → Email sender: sends confirmation
- Admin dashboard → API service: approves or rejects
- Payment callback → MySQL database: updates payment and adoption
- Payment callback → Email sender: sends confirmation
- Payment endpoints → M-Pesa: initiates transaction
- Email sender → SMTP server: sends email