How do you split code in a monorepo to share contracts without exposing secrets?
Review note: The answer refers to the original author's CV or target job offer — adapt it to your own experience.
Answer out loud or in your head first, then compare.
Answer
A monorepo means several parts of a project live in one repository. I can extract a shared package that describes the data sent between frontend and backend. But it shouldn't also import the database connection or secret configuration.
Example: both sides use a form schema, but only the server has access to the database password. I watch the direction of dependencies and check what ends up in the browser code. One repo doesn't have to mean deploying everything at once. So a change to an API field should still work when, for a while, an old frontend talks to a new server.
Why it matters: The full job offer mentions a TypeScript monorepo and shared contracts.
Possible follow-ups: How do you add a new field without breaking an older client?
How did it go? Be honest — “Not yet” puts the question on your review list.
Start with
- B-P01 · What is Node.js, and how is it different from JavaScript in the browser? — JavaScript, TypeScript and Node.js
- B-P04 · What is a Promise? — JavaScript, TypeScript and Node.js
- B-P10 · What does TypeScript give you, and what doesn't it? — JavaScript, TypeScript and Node.js
Further reading
- TypeScript Handbook: Narrowing(opens in a new tab)Docs; accessed 22.10.2026. Narrowing, discriminated unions and exhaustiveness.