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
Case study, personal project
A platform for pet-store networks, from the database to the shared UI.
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
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
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
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
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
Zod validates every route input and the environment. Failures become type errors before runtime surprises.
trade-off: stricter schemas to maintain
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.”