← All work

Case study, personal project

Adopets

A platform for pet-store networks, from the database to the shared UI.

Role
Solo: product, design, full stack
Scope
Auth, roles, stores, clinic, sales
Stack
Turborepo, React, Fastify, Prisma

Why build it

A pet store is more than a shop: it sells products, keeps stock, books the vet and remembers every animal. A chain multiplies that by every location, and each person should see only what their role and store allow.

I wanted to practice monorepo boundaries, permission modeling and a shared UI package in a domain that feels real.

Architecture

Three apps, one source of truth.

apps/web

React interface: store, services, routes

apps/docs

Next.js documentation

apps/server

Fastify and Prisma REST API, JWT auth

▲ all three import from ▼

packages/ui

@adopets/ui, shared components

packages/eslint-config

one lint standard

packages/typescript-config

one tsconfig base

Access model

Who sees what, and where.

network

a chain or franchise

store

stock, sales, clinic

role per store

SUPERADMIN, ADMIN, EMPLOYEE

Roles are checked in middleware: the store comes from the token, and a permission helper decides what each role can do on each resource.

Decisions

The why behind the shape.

A monorepo for one person

Shared types, UI and config between web and API keep the codebase consistent. Turborepo makes builds and tasks fast even solo.

trade-off: more upfront tooling

Roles live on the store, not the user

A person can be ADMIN in one store and EMPLOYEE in another, so the join table is role × store × user. This matches the business better than a global role.

trade-off: more complex auth queries

Validate at the edge

Zod validates every route input and the environment. Failures become type errors before runtime surprises.

trade-off: stricter schemas to maintain

Domain-shaped routes

Routes are grouped by domain — auth, user, product, transaction — instead of by technical layer, so the API reads like the product.

What I’d do next

Add an audit log for sales, expose a live demo and raise test coverage for the permission layer. Showing the gaps is part of senior work.

“The hardest part was not the schema; it was deciding who gets to see which row.”