PawFinder is a REST API for managing
pet adoption data. All endpoints use JSON for requests
and responses, available at http://localhost:3000.
GET requests are public and don’t require authentication.
All write operations - POST, PUT, PATCH, and DELETE -
require a valid API token. Visit the
Authentication Guide
for more information.
PawFinder is an educational project using json-server and minimal
authentication. A production system would likely use a more robust
architecture resembling the diagram below:
graph TB
Client["Client Applications<br/>(Web, Mobile, Desktop)"]
Gateway["API Gateway"]
Auth["Authentication<br/>Service"]
PetService["Pet Service"]
ShelterService["Shelter Service"]
AdoptionService["Adoption Service"]
PetDB["Pet Database"]
ShelterDB["Shelter Database"]
AdoptionDB["Adoption Database"]
Cache["Cache Layer"]
Client -->|HTTP Requests| Gateway
Gateway -->|Route Requests| Auth
Gateway -->|Route Requests| PetService
Gateway -->|Route Requests| ShelterService
Gateway -->|Route Requests| AdoptionService
Auth -->|Verify| Gateway
PetService -->|Read/Write| PetDB
PetService -->|Cache| Cache
ShelterService -->|Read/Write| ShelterDB
ShelterService -->|Cache| Cache
AdoptionService -->|Read/Write| AdoptionDB
style Client fill:#9989c4,stroke:#333,stroke-width:2px,color:#fff,font-family:Helvetica
style Gateway fill:#cc848a,stroke:#333,stroke-width:2px,color:#000,font-family:Helvetica
style PetService fill:#88b2c4,stroke:#333,stroke-width:2px,color:#ffffont-family:Helvetica
style ShelterService fill:#88b2c4,stroke:#333,stroke-width:2px,color:#ffffont-family:Helvetica
style AdoptionService fill:#88b2c4,stroke:#333,stroke-width:2px,color:#ffffont-family:Helvetica
style Auth fill:#c5d3a6,stroke:#333,stroke-width:2px,color:#000font-family:Helvetica
style PetDB fill:#add8e6,stroke:#333,stroke-width:2px,color:#000font-family:Helvetica
style ShelterDB fill:#add8e6,stroke:#333,stroke-width:2px,color:#000font-family:Helvetica
style AdoptionDB fill:#add8e6,stroke:#333,stroke-width:2px,color:#000font-family:Helvetica
style Cache fill:#9fb56a,stroke:#333,stroke-width:2px,color:#000font-family:Helvetica
/pets operationsGET all pet profilesGET pet profiles by idGET pet profiles from a specific shelterGET pet profiles using filtersPOST pet profilesPUT pet profiles by idPATCH pet profiles by idDELETE pet profiles by id/shelters operationsGET all shelter profilesGET shelter profiles by idPOST shelter profilesPUT shelter profiles by idPATCH shelter profiles by idDELETE shelter profiles by id| Code | Scenario | Response |
|---|---|---|
401 |
Missing API token | { "error": "Unauthorized", "message": "Authentication token is required for this operation." } |
403 |
Invalid or expired API token | { "error": "Forbidden", "message": "Invalid or expired authentication token." } |
429 |
Rate limit exceeded | { "error": "Too Many Requests", "message": "Rate limit exceeded. Try again in 60 seconds.", ... } |
500 |
Server error | { "error": "Internal Server Error", "message": "An unexpected error occurred. Please try again later." } |
503 |
API under maintenance | { "error": "Service Unavailable", "message": "API is temporarily unavailable for maintenance." } |
If encountering connection errors like Connection refused or
ENOBUFS while testing with high request volumes, this typically
indicates the local port is reaching its connection limit.
This is normal during stress testing and doesn’t reflect production
API performance. To continue testing locally, either increase OS
connection limits, run many instances on different ports such as
3001, 3002, or test against a staging environment if available.
OS-specific guidance:
ulimit -n to check current file descriptor
limits and change /etc/security/limits.conf to increase themlaunchctl maxfiles to adjust file limits,
or change /etc/launchd.conf for persistent changesHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
and adjust MaxUserPort to increase ephemeral port rangePawFinder doesn’t use URI versioning, but a production environment might include a version support policy resembling the following:
Sunset header indicating
end-of-life date.