Skip to content
Youssef M.

Case study · Web application

Gym CRM

A gym management app where reception checks members in with a QR pass, and the app refuses entry when a membership has lapsed.

  • Next.js
  • TypeScript
  • PostgreSQL
  • Prisma

A project by Youssef Manssouri

What I built
Built member management, subscription workflows, role-based access and a QR check-in endpoint.
Verifiable result
Inspect the Prisma schema and check-in route, or explore the live demo with role-specific access.
Status, audience and limitations
For whom:
Gym reception teams managing members, subscriptions and attendance.
Status:
Independent gym-management prototype with a deployed demonstration.
Limitations:
The public demo is read-only: visitors can explore the staff screens but cannot change data. Existing workflows are distinct from proposed integrations. Generated fitness content demonstrates a technical feature, not professional advice.

The problem

At busy hours, reception looks members up by hand, people with expired subscriptions slip through, and attendance ends up on paper. Staff also need different access from members, but simple gym tools often show everyone the same data. I wanted check-in to be fast and correct, with each role seeing only what it should.

What I built

Dashboard: active members, revenue split between subscriptions and shop sales, and today's check-ins by hour.
Members: each member has a QR code, a plan and a renewal date; the status shows whether the membership is active, expired or frozen.
Payments: membership renewals and front-desk shop sales in one ledger, each with a printable receipt.

Key decisions

  1. Check-in verifies the membership before logging entry

    The check-in endpoint looks the member up by QR code and only records attendance if the account and the latest membership are active and not past their end date.

    Trade-off: Check-in is only as accurate as the membership data: a renewal has to be recorded before the member arrives.

  2. Repeat scans within two minutes are rejected

    Scanners often read a pass twice. A second check-in for the same member within two minutes returns an HTTP 409 conflict instead of counting a second visit.

    Trade-off: A member who genuinely leaves and comes back within two minutes is not counted twice.

  3. Roles are checked on the server, not in the interface

    Five roles (admin, manager, trainer, receptionist, member) are checked on the server by the staff API routes, so a member's session cannot use them even if it finds them.

    Trade-off: Public sign-up only creates member accounts. To show the staff screens, the demo signs visitors into a shared read-only account: the middleware rejects every request that would change data. A real gym would add staff accounts itself.

What I learned

Security in facility software lives in the API routes, not in which buttons are visible. And when an app depends on an external AI service for workout plans, it needs a rule-based fallback so the feature still works when the service is slow or unavailable.

Check it yourself