How haolader91/rabina-book-server-2 works
This is an Express API for a bookstore. Clients send requests through the server and app into versioned routes, which dispatch catalog operations or Better Auth handling; book and category services use Prisma to access PostgreSQL. The sampled code shows catalog CRUD and soft deletion, plus authentication configuration. The separate registration service is not mounted in the sampled route tree, and the README is empty, so neither is represented as an active workflow.
Main entry points: index.ts API routes · prisma.ts Prisma client · server.ts HTTP server · app.ts Express app
Components 10
HTTP API
- HTTP server
src/server.ts - Express app
src/app.ts - API routes
src/routes/index.ts
Bookstore domains
- Book service
src/services/books.ts - Category service
src/services/categories.ts
Auth and storage
- Auth handler
src/lib/auth.ts - Prisma client
src/lib/prisma.ts - Data schema
prisma/schema.prisma - PostgreSQL
Other components
- API client
Connections 11
- API client → HTTP server: sends requests
- HTTP server → Express app: starts
- Express app → API routes: mounts API
- API routes → Book service: dispatches books
- API routes → Category service: dispatches categories
- API routes → Auth handler: dispatches auth
- Book service → Prisma client: queries
- Category service → Prisma client: queries
- Auth handler → Prisma client: uses adapter
- Prisma client → PostgreSQL: reads and writes
- Data schema → PostgreSQL: defines data model