Skip to content
Youssef M.

Case study · Web application

BusinessOS

A web app where a small service business manages clients, invoices and bookings in one place, with each company's data kept separate.

  • Next.js
  • TypeScript
  • PostgreSQL
  • Prisma

A project by Youssef Manssouri

What I built
Built company-scoped workflows, invoice snapshots, staff scheduling and server-side role checks.
Verifiable result
Issued invoices keep the client details they were sent with, and one company cannot read another company's data. Both are checked by the 14 test suites in the repository.
Status, audience and limitations
For whom:
Service teams managing CRM, invoices and bookings.
Status:
Independent software project with a deployed demonstration.
Limitations:
The demo requires sign-in and uses realistic demo data. Tests document checks, not guaranteed security or commercial adoption.

The problem

Small service businesses often keep contacts in one tool, invoices in another and appointments in a calendar. Details drift apart: a client's address changes in one place but not the others, two staff get booked at the same time, and editing a client can quietly change invoices that were already sent. I wanted one app where these records stay linked and stay correct.

What I built

Dashboard: collected revenue, unpaid invoices and upcoming bookings, computed from the same records the other screens edit.
Invoices: overdue status is worked out from the due date, and paid invoices can no longer be edited or deleted.
Bookings: times are entered in the company's own timezone, and overlapping bookings for the same person are refused.

Key decisions

  1. Every query is scoped to the signed-in company

    The company id comes from the verified session, never from the request, and every read and write filters by it. Changing an id in the URL cannot reach another company's records.

    Trade-off: Every new feature has to follow the same rule and needs its own cross-company test.

  2. Invoices keep a copy of what was billed

    An issued invoice stores the client's name, address, tax rate and line prices at that moment. Editing the client later does not change old invoices.

    Trade-off: Some data is stored twice, and correcting an issued invoice needs an explicit step instead of a silent update.

  3. One relational database for every module

    Clients, deals, invoices and bookings are linked with PostgreSQL foreign keys through Prisma, so a booking or an invoice always points to a real client.

    Trade-off: Schema changes need migrations, and deleting a client must respect the invoices linked to it.

What I learned

The hard part of business software is not the screens but the rules between them: who may change what, and what must never change once it is issued. Hiding a button is not security; the server has to check the company and the role on every action. The cross-company tests check exactly the kind of mistake the interface would never show.

Check it yourself