Sufrá is a comprehensive restaurant reservation and food ordering system designed with scalability and domain-driven principles in mind. The platform serves three distinct user roles with robust features, implemented using modern architectural patterns and performance-optimized database operations.
- 🌐 Live Site: https://sufraa.vercel.app
⚠️ The project is under active development. You may encounter unfinished features or test data. Continuous deployments are used to keep the demo updated.
Deployment Stack:
- Frontend: Vercel
- Backend: Dockerized on Railway
- Database: Supabase (PostgreSQL)
-
Production-Grade Architecture
- Layered design with clear separation of concerns, evolving toward Domain-Driven Design (DDD)
- Utilized aggregates and root aggregates to build rich domain models in key entities
-
Performance Optimizations
- Trigram-based fuzzy search using PostgreSQL similarity (
pg_trgm
extension) - N+1 query prevention with strategic eager/lazy loading
- Pagination and filtering across all listings for scalable performance
- Trigram-based fuzzy search using PostgreSQL similarity (
-
Email Integration
- Automated email notifications for confirmations and rejections
- QR code generation for reservation confirmation
-
Advanced Reservation Logic
- Smart table allocation with "max effort" capacity management
- Fallback strategies for handling edge cases and overbookings
- Secure authentication and access control
- Full CRUD operations on restaurants, including approval and blocking
- Advanced search with trigram-based fuzzy matching combined with multi-criteria filtering and paginated results
- System-wide oversight of all reservations and orders with pagination and dynamic filtering
- Register your restaurant and login to your dashboard
- Full CRUD for tables with labels and seating capacities
- Define and update operating hours
- Manage menu sections and menu items (CRUD)
- Update order status through full lifecycle: Pending → Preparing → Ready → Delivered/Canceled
- Approve or reject reservations with automated email notifications and QR code confirmations
- Secure registration and login
- Discover approved restaurants with fuzzy search, filtering, and pagination
- Browse restaurant menus organized by sections
- Book tables with a smart reservation system and fallback handling
- Cancel reservations when needed
- Manage cart, place orders, cancel if unprepared, and track order status
- Receive email confirmations with QR codes for reservations
- Framework: .NET 9
- Database: PostgreSQL (with
pg_trgm
extension) - Authentication: JWT with BCrypt password hashing
- Email: SMTP integration with templated messages
- Framework: React
- Styling: Tailwind CSS
- Prototyped in Figma with complete UI designs
View Figma Designs
graph TD
A[Controller] --> B[Application Service Layer]
B --> C[Repository]
C --> D[PostgreSQL]
B --> E[Domain Models]
style E stroke:#ff6e96,stroke-width:2px
For development, you can run PostgreSQL in a Docker container for consistency and easy setup:
docker run --name sufra-postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=sufra_v2 \
-p 5432:5432 \
-d postgres:latest
### Clone the repository
git clone https://github.com/IbrahimElFitiany/SufraAPI
cd SufraAPI
### Restore dependencies
dotnet restore
### Apply database migrations
dotnet ef database update
### Run the backend server
dotnet run
- Import the Postman collection to explore and test all available API endpoints:
Download Postman Collection
-
The frontend is maintained separately and still under active development:
-
Optimize Entity Framework Queries
Replace.Include()
calls with.Select()
projections where only specific fields are needed
(e.g.,Cuisine.Name
,District.Name
,Gov.Name
) to reduce unnecessary data loading and improve performance. -
Implement Transactional Consistency (Unit of Work)
Currently, creating aManager
and their associatedRestaurant
occurs in separate steps.
If the restaurant creation fails, it may leave orphaned manager records.
I plan to refactor this flow using the Unit of Work pattern to wrap related operations in a single transaction,
ensuring data consistency and atomicity.