How outro-lucas/pet-valley-api works
Adopet is an animal-adoption API: adopters browse animal listings and submit an adoption request; organizations and adopters then progress it through interview, home visit, contract, and travel, or cancel it. Express routes dispatch to controllers, which delegate to services; services use TypeORM with SQLite. The README documents the broader adoption stages and listing/organization capabilities. Notification and dashboard services described in the README are not present in the supplied tree; relationships are limited to those evidenced by excerpts, the source index, or README.
Main entry points: app.ts Express API · auth.middleware.ts Token authentication · database.ts TypeORM data source · animal.service.ts Animal catalog service
Components 24
API entry and access
- Express API
src/app.ts - Auth routes
src/routes/auth.routes.ts - User routes
src/routes/users.routes.ts - Organization routes
src/routes/organization.routes.ts - Animal routes
src/routes/animal.routes.ts - Adoption routes
src/routes/adoption.routes.ts - Token authentication
src/middleware/auth.middleware.ts - Role authorization
src/middleware/role.middleware.ts
Accounts and organizations
- Auth controller
src/controllers/auth.controller.ts - User controller
src/controllers/users.controller.ts - Organization controller
src/controllers/organizations.controller.ts - Authentication service
src/services/auth.service.ts - User service
src/services/user.service.ts - Organization service
src/services/organization.service.ts
Animal listings
- Animal controller
src/controllers/animal.controller.ts - Animal catalog service
src/services/animal.service.ts
Adoption process
- Adoption controller
src/controllers/adoption.controller.ts - Adoption workflow service
src/services/adoption.service.ts
Persistence and media
- Domain entities
src/entities - TypeORM data source
src/utils/database.ts - SQLite database
database/adopet.sqlite - GitHub Pages media
src/services/github-pages.service.ts
Other components
- Adopter or organization
- GitHub Pages
Connections 38
- Adopter or organization → Express API: sends requests
src/app.ts - Express API → Auth routes: mounts routes
src/app.ts - Express API → User routes: mounts routes
src/app.ts - Express API → Organization routes: mounts routes
src/app.ts - Express API → Animal routes: mounts routes
src/app.ts - Express API → Adoption routes: mounts routes
src/app.ts - Auth routes → Auth controller: dispatches to
src/routes/auth.routes.ts - User routes → User controller: dispatches to
src/routes/users.routes.ts - Organization routes → Organization controller: dispatches to
src/routes/organization.routes.ts - Animal routes → Animal controller: dispatches to
src/routes/animal.routes.ts - Adoption routes → Adoption controller: dispatches to
src/routes/adoption.routes.ts - Auth routes → Token authentication: authenticates with
src/routes/auth.routes.ts - User routes → Token authentication: authenticates with
src/routes/users.routes.ts - Organization routes → Token authentication: authenticates with
src/routes/organization.routes.ts - Organization routes → Role authorization: checks roles
src/routes/organization.routes.ts - Animal routes → Token authentication: authenticates with
src/routes/animal.routes.ts - Animal routes → Role authorization: checks roles
src/routes/animal.routes.ts - Adoption routes → Token authentication: authenticates with
src/routes/adoption.routes.ts - Auth controller → Authentication service: calls
src/controllers/auth.controller.ts - User controller → User service: calls
src/controllers/users.controller.ts - Organization controller → Organization service: calls
src/controllers/organizations.controller.ts - Animal controller → Animal catalog service: calls
src/controllers/animal.controller.ts - Adoption controller → Adoption workflow service: calls
src/controllers/adoption.controller.ts - Token authentication → Authentication service: validates token
src/middleware/auth.middleware.ts - Authentication service → TypeORM data source: uses repositories
src/services/auth.service.ts - User service → TypeORM data source: uses repositories
src/services/user.service.ts - Organization service → TypeORM data source: uses repositories
src/services/organization.service.ts - Animal catalog service → TypeORM data source: uses repository
src/services/animal.service.ts - Adoption workflow service → TypeORM data source: uses repository
src/services/adoption.service.ts - TypeORM data source → SQLite database: configures store
src/utils/database.ts - Authentication service → Domain entities: persists accounts
src/services/auth.service.ts - User service → Domain entities: persists users
src/services/user.service.ts - Organization service → Domain entities: persists organizations
src/services/organization.service.ts - Animal catalog service → Domain entities: persists animals
src/services/animal.service.ts - Adoption workflow service → Domain entities: persists adoptions
src/services/adoption.service.ts - Adoption workflow service → Animal catalog service: updates animal status
src/services/adoption.service.ts - Animal catalog service → GitHub Pages media: uploads images
src/services/animal.service.ts - GitHub Pages media → GitHub Pages: stores images