Overview
Shghilni is a marketplace platform connecting service providers with customers across multiple verticals. The platform handles complex matching logic, dynamic pricing, real-time availability, and multi-party transactions. The core challenge was building a system flexible enough to support diverse service types while maintaining a coherent user experience and reliable backend operations.
My Role
I designed and built the core platform architecture from the ground up. This included the service matching algorithm, the booking and transaction flow, provider onboarding systems, and the admin dashboard. I also implemented the API layer, database schema, and payment integrations. On the frontend, I built the customer-facing web app and provider management interfaces using React and Next.js.
Architecture
The system follows a modular monolith pattern — keeping deployment simple while maintaining clear domain boundaries. The database layer uses PostgreSQL with Prisma, structured around core entities: Users, Providers, Services, Bookings, and Transactions. I designed the schema to support multi-tenancy from day one, anticipating future white-label deployments. The API is built with tRPC for end-to-end type safety, with separate procedure routers for each domain. The frontend uses Next.js App Router with server components for initial loads and client components for interactive elements.
Hard Problems
- Designing a flexible service schema that could represent vastly different service types (hourly, fixed-price, subscription) without becoming a mess of nullable fields.
- Building a matching algorithm that balanced provider availability, location, ratings, and pricing — while remaining fast enough for real-time search.
- Handling concurrent booking requests for the same time slots without overselling or creating poor user experiences.
- Implementing a transaction system that correctly handled deposits, partial payments, cancellations, and refunds across multiple payment providers.
- Creating an admin interface that gave operators visibility into platform health without overwhelming them with data.
What I'd Improve
The initial matching algorithm prioritized simplicity over sophistication. With more data, I'd invest in a scoring system that learns from successful bookings. The admin dashboard works but could benefit from better real-time monitoring and alerting. I'd also extract the payment handling into a more isolated service — the current implementation is well-tested but tightly coupled to the booking flow, making future payment provider additions more work than necessary.