bookflex
A plugin-based CRM system built with Next.js, designed for businesses like dentistry, pharmacy, and specialized services. Features can be toggled on/off via database feature flags, allowing modules to be enabled/disabled without code changes.
Problem
A dental practice and a pharmacy want most of the same CRM and disagree about the rest. Shipping that as one codebase usually means a fork per client, and shipping it as a product usually means every customer carries every feature.
Approach
A plugin architecture where the feature set is a database record rather than a build flag. Core capabilities are always on, and everything above that is toggled per deployment without touching code or redeploying. Next.js 16 with the App Router, Mongoose and Typegoose over MongoDB, and role-based access separating admin from customer.
Outcome
- Appointment management ships complete: calendar booking, time-slot selection, availability checking and admin status updates.
- Payments, an AI chatbot and stock management are scaffolded behind their own flags, so enabling one is a database write.
- 349 files across 71 commits, with CI and dependabot wired up from the start.